Simplify specs

This commit is contained in:
Maikel Linke
2017-08-19 11:01:36 +10:00
parent 20b2e831e9
commit 0f1fb68ee8
2 changed files with 4 additions and 10 deletions

View File

@@ -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'

View File

@@ -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