From 0b636c1d89fa0db25ca32ad508901477b76cd29e Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 8 Jan 2015 15:04:48 +1100 Subject: [PATCH] Combine spec cases for faster runtime --- spec/features/admin/reports_spec.rb | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/spec/features/admin/reports_spec.rb b/spec/features/admin/reports_spec.rb index 4e2e372225..93b0495ef7 100644 --- a/spec/features/admin/reports_spec.rb +++ b/spec/features/admin/reports_spec.rb @@ -130,29 +130,24 @@ feature %q{ click_link "Sales Tax" end - it "displays the report" do + it "reports" do + # Then it should give me access only to managed enterprises page.should have_select 'q_distributor_id_eq', with_options: [user1.enterprises.first.name] page.should_not have_select 'q_distributor_id_eq', with_options: [user2.enterprises.first.name] + # When I filter to just one distributor select user1.enterprises.first.name, from: 'q_distributor_id_eq' click_button 'Search' - + + # Then I should see the relevant order page.should have_content "#{order1.number}" - end - it "calculates sales tax on orders" do - select user1.enterprises.first.name, from: 'q_distributor_id_eq' - click_button 'Search' - - page.should have_content "1512.99" #items total - page.should have_content "1500.45" #taxable items total - page.should have_content "300.09" #sales tax - end + # And the totals and sales tax should be correct + page.should have_content "1512.99" # items total + page.should have_content "1500.45" # taxable items total + page.should have_content "300.09" # sales tax - it "calculates shipping tax on orders" do - select user1.enterprises.first.name, from: 'q_distributor_id_eq' - click_button 'Search' - + # And the shipping cost and tax should be correct page.should have_content "100.55" #shipping cost page.should have_content "20.11" #shipping tax end