From 64c9d4254a39ed00da01635ff547eb89087fa89b Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Mon, 19 Aug 2013 17:28:00 +1000 Subject: [PATCH] Fix spec failures - enterprise fee calculator type change, distributor info rich text tests, summarised distribution fee at checkout --- spec/features/admin/enterprise_fees_spec.rb | 2 +- spec/features/consumer/checkout_spec.rb | 26 ++++----------------- spec/features/consumer/product_spec.rb | 15 +++--------- 3 files changed, 9 insertions(+), 34 deletions(-) diff --git a/spec/features/admin/enterprise_fees_spec.rb b/spec/features/admin/enterprise_fees_spec.rb index 71e262b70d..9d011ce493 100644 --- a/spec/features/admin/enterprise_fees_spec.rb +++ b/spec/features/admin/enterprise_fees_spec.rb @@ -27,7 +27,7 @@ feature %q{ page.should have_selector "#enterprise_fee_set_collection_attributes_0_enterprise_id" page.should have_selector "option[selected]", text: 'Packing' page.should have_selector "input[value='$0.50 / kg']" - page.should have_selector "option[selected]", text: 'Flat Rate (per order)' + page.should have_selector "option[selected]", text: 'Flat Rate (per item)' page.should have_selector "input[value='#{amount}']" end diff --git a/spec/features/consumer/checkout_spec.rb b/spec/features/consumer/checkout_spec.rb index 8a84df61a9..d474ea76bc 100644 --- a/spec/features/consumer/checkout_spec.rb +++ b/spec/features/consumer/checkout_spec.rb @@ -89,13 +89,6 @@ feature %q{ ['Product distribution by Edible garden for Garlic', '$2.00', '']] page.should have_selector 'span.distribution-total', :text => '$3.00' - - # When I check out - click_link 'Checkout' - - # Then I should see a summary of my distribution charges - page.should have_selector 'tbody#summary-order-charges td', text: 'Distribution:' - page.should have_selector 'tbody#summary-order-charges td', text: '$3.00' end scenario "viewing delivery fees for order cycle distribution" do @@ -295,18 +288,9 @@ feature %q{ # Distributor details should be displayed within('fieldset#shipping') do [@distributor.name, - @distributor.address.address1, - @distributor.address.city, - @distributor.address.zipcode, - @distributor.address.state_text, - @distributor.address.country.name, - @distributor.pickup_times, - @distributor.next_collection_at, - @distributor.contact, - @distributor.phone, - @distributor.email, - @distributor.description, - @distributor.website].each do |value| + @distributor.distributor_info, + @distributor.next_collection_at + ].each do |value| page.should have_content value end @@ -319,8 +303,8 @@ feature %q{ # -- Checkout: Delivery order_charges = page.all("tbody#summary-order-charges tr").map {|row| row.all('td').map(&:text)}.take(2) - order_charges.should == [["Product distribution by Edible garden for Fuji apples:", "$1.00"], - ["Product distribution by Edible garden for Garlic:", "$2.00"]] + order_charges.should == [["Shipping:", "$0.00"], + ["Distribution:", "$3.00"]] click_checkout_continue_button # -- Checkout: Payment diff --git a/spec/features/consumer/product_spec.rb b/spec/features/consumer/product_spec.rb index 4c983294b0..efd4fa1689 100644 --- a/spec/features/consumer/product_spec.rb +++ b/spec/features/consumer/product_spec.rb @@ -44,18 +44,9 @@ feature %q{ within '#product-distributor-details' do [d.name, - d.address.address1, - d.address.city, - d.address.zipcode, - d.address.state_text, - d.address.country.name, - d.pickup_times, - d.next_collection_at, - d.contact, - d.phone, - d.email, - d.description, - d.website].each do |value| + d.distributor_info, + d.next_collection_at + ].each do |value| page.should have_content value end