From e9fa360d61b68d4bd9647101d112c2dc1505767b Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 24 Feb 2023 13:41:59 +1100 Subject: [PATCH] Take test setup as granted and simplify --- spec/system/admin/enterprises/index_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/system/admin/enterprises/index_spec.rb b/spec/system/admin/enterprises/index_spec.rb index a2b5c47901..a5cbdf6174 100644 --- a/spec/system/admin/enterprises/index_spec.rb +++ b/spec/system/admin/enterprises/index_spec.rb @@ -39,8 +39,7 @@ describe 'Enterprises Index' do let!(:d_manager) { create(:user, enterprise_limit: 1) } before do - d_manager.enterprise_roles.build(enterprise: d).save - expect(d.owner).to_not eq d_manager + d.users << d_manager end context "without violating rules" do @@ -68,8 +67,7 @@ describe 'Enterprises Index' do let!(:second_distributor) { create(:distributor_enterprise, sells: 'none') } before do - d_manager.enterprise_roles.build(enterprise: second_distributor).save - expect(d.owner).to_not eq d_manager + second_distributor.users << d_manager login_as_admin_and_visit admin_enterprises_path end