From 0f1fb68ee809575c9dfe19b575049d3f38417bbc Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Sat, 19 Aug 2017 11:01:36 +1000 Subject: [PATCH] Simplify specs --- .rubocop_todo.yml | 1 - spec/features/consumer/shops_spec.rb | 13 ++++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ee8e61e8a2..dd05d120e6 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -455,7 +455,6 @@ Layout/LeadingCommentSpace: - 'spec/factories.rb' - 'spec/features/admin/products_spec.rb' - 'spec/features/admin/reports_spec.rb' - - 'spec/features/consumer/shops_spec.rb' - 'spec/jobs/finalize_account_invoices_spec.rb' - 'spec/lib/open_food_network/order_and_distributor_report_spec.rb' - 'spec/lib/open_food_network/order_grouper_spec.rb' diff --git a/spec/features/consumer/shops_spec.rb b/spec/features/consumer/shops_spec.rb index 192ed4bff8..95b2e59af5 100644 --- a/spec/features/consumer/shops_spec.rb +++ b/spec/features/consumer/shops_spec.rb @@ -22,7 +22,7 @@ feature 'Shops', js: true do end - context "on the shops path" do + describe "listing shops" do before do visit shops_path end @@ -37,21 +37,17 @@ feature 'Shops', js: true do expect(page).not_to have_content invisible_distributor.name end - it "should not show hubs that are not in an order cycle" do - create(:simple_product, distributors: [d1, d2]) - visit shops_path + it "does not show hubs that are not in an order cycle" do expect(page).to have_no_selector 'hub.inactive' expect(page).to have_no_selector 'hub', text: d2.name end - it "should show closed shops after clicking the button" do - create(:simple_product, distributors: [d1, d2]) - visit shops_path + it "shows closed shops after clicking the button" do click_link_and_ensure("Show closed shops", -> { page.has_selector? 'hub.inactive' }) expect(page).to have_selector 'hub.inactive', text: d2.name end - it "should link to the hub page" do + it "links to the hub page" do follow_active_table_node distributor.name expect(page).to have_current_path enterprise_shop_path(distributor) end @@ -183,7 +179,6 @@ feature 'Shops', js: true do end it "shows closed shops" do - #click_link_and_ensure("Show closed shops", -> { page.has_selector? 'hub.inactive' }) expect(page).to have_selector 'hub.inactive', text: d2.name end end