From 0b390549546b778f2b5333453f8a3e737ea14504 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 7 Aug 2018 12:33:26 +1000 Subject: [PATCH] Speed up relationships spec From 18s to 12s: 33% speed up --- spec/features/admin/enterprise_relationships_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/features/admin/enterprise_relationships_spec.rb b/spec/features/admin/enterprise_relationships_spec.rb index 82c92850d4..45d26a9e87 100644 --- a/spec/features/admin/enterprise_relationships_spec.rb +++ b/spec/features/admin/enterprise_relationships_spec.rb @@ -9,7 +9,7 @@ feature %q{ context "as a site administrator" do - before { login_to_admin_section } + before { quick_login_as_admin } scenario "listing relationships" do # Given some enterprises with relationships @@ -19,6 +19,7 @@ feature %q{ create(:enterprise_relationship, parent: e3, child: e4, permissions_list: [:add_to_order_cycle, :manage_products]) # When I go to the relationships page + visit spree.admin_path click_link 'Enterprises' click_link 'Permissions' @@ -97,7 +98,7 @@ feature %q{ let!(:er2) { create(:enterprise_relationship, parent: d2, child: d1) } let!(:er3) { create(:enterprise_relationship, parent: d2, child: d3) } - before { login_to_admin_as enterprise_user } + before { quick_login_as enterprise_user } scenario "enterprise user can only see relationships involving their enterprises" do visit admin_enterprise_relationships_path @@ -107,7 +108,6 @@ feature %q{ page.should_not have_relationship d2, d3 end - scenario "enterprise user can only add their own enterprises as parent" do visit admin_enterprise_relationships_path page.should have_select2 'enterprise_relationship_parent_id', options: ['', d1.name]