diff options
author | Małgorzata Ksionek <meksionek@gmail.com> | 2019-03-13 13:54:06 +0300 |
---|---|---|
committer | Małgorzata Ksionek <meksionek@gmail.com> | 2019-03-13 13:54:06 +0300 |
commit | 03fa783409694e6748b2b0ac06315a8d2dfd2c7e (patch) | |
tree | c71c87333e1a92123ed9f51ba29ccecd51291748 /spec/policies | |
parent | e285fb50498912c7fbabf5edfe64a9bedd85fc71 (diff) |
Add cr remarks
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/group_policy_spec.rb | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb index 28fc7e0ddf5..92bdaa8b8b8 100644 --- a/spec/policies/group_policy_spec.rb +++ b/spec/policies/group_policy_spec.rb @@ -76,23 +76,13 @@ describe GroupPolicy do context 'with no user and public project' do let(:project) { create(:project, :public) } - let(:user) { create(:user) } let(:current_user) { nil } before do - group.add_developer(user) - - Projects::GroupLinks::CreateService.new( - project, - user, - link_group_access: ProjectGroupLink::DEVELOPER - ).execute(group) + create(:project_group_link, project: project, group: group) end - it do - expect(group.shared_projects).not_to be_empty - expect_disallowed(:read_group) - end + it { expect_disallowed(:read_group) } end context 'with foreign user and public project' do @@ -101,19 +91,10 @@ describe GroupPolicy do let(:current_user) { create(:user) } before do - group.add_developer(user) - - Projects::GroupLinks::CreateService.new( - project, - user, - link_group_access: ProjectGroupLink::DEVELOPER - ).execute(group) + create(:project_group_link, project: project, group: group) end - it do - expect(group.shared_projects).not_to be_empty - expect_disallowed(:read_group) - end + it { expect_disallowed(:read_group) } end context 'has projects' do |