From edb32218b0de1cda68a84875dc6b15ab59cb916e Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 7 Aug 2018 12:11:15 +1000 Subject: [PATCH] Use quick login to speed up product edit spec From 48s to 44s: 8% speed up --- spec/features/admin/enterprise_fees_spec.rb | 22 ++++++++------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/spec/features/admin/enterprise_fees_spec.rb b/spec/features/admin/enterprise_fees_spec.rb index 9307574bc4..50d8412116 100644 --- a/spec/features/admin/enterprise_fees_spec.rb +++ b/spec/features/admin/enterprise_fees_spec.rb @@ -30,9 +30,8 @@ feature %q{ e = create(:supplier_enterprise, name: 'Feedme') # When I go to the enterprise fees page - login_to_admin_section - click_link 'Configuration' - click_link 'Enterprise Fees' + quick_login_as_admin + visit admin_enterprise_fees_path # And I fill in the fields for a new enterprise fee and click update select 'Feedme', from: 'enterprise_fee_set_collection_attributes_0_enterprise_id' @@ -60,9 +59,8 @@ feature %q{ enterprise = create(:enterprise, name: 'Foo') # When I go to the enterprise fees page - login_to_admin_section - click_link 'Configuration' - click_link 'Enterprise Fees' + quick_login_as_admin + visit admin_enterprise_fees_path # And I update the fields for the enterprise fee and click update select 'Foo', from: 'enterprise_fee_set_collection_attributes_0_enterprise_id' @@ -95,11 +93,8 @@ feature %q{ fee = create(:enterprise_fee) # When I go to the enterprise fees page - login_to_admin_section - click_link 'Configuration' - expect(page).to have_link 'Enterprise Fees' - click_link 'Enterprise Fees' - expect(page).to have_content 'Enterprise Fees' + quick_login_as_admin + visit admin_enterprise_fees_path # And I click delete find("a.delete-resource").click @@ -117,9 +112,8 @@ feature %q{ create(:product_distribution, product: p, distributor: d, enterprise_fee: fee) # When I go to the enterprise fees page - login_to_admin_section - click_link 'Configuration' - click_link 'Enterprise Fees' + quick_login_as_admin + visit admin_enterprise_fees_path # And I click delete find("a.delete-resource").click