diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/services/issues/move_service_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/services/issues/move_service_spec.rb')
-rw-r--r-- | spec/services/issues/move_service_spec.rb | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/spec/services/issues/move_service_spec.rb b/spec/services/issues/move_service_spec.rb index ae1454ce9bb..9b8d21bb8eb 100644 --- a/spec/services/issues/move_service_spec.rb +++ b/spec/services/issues/move_service_spec.rb @@ -321,21 +321,40 @@ RSpec.describe Issues::MoveService do before do authorized_project.add_developer(user) + authorized_project.add_developer(admin) authorized_project2.add_developer(user) + authorized_project2.add_developer(admin) end context 'multiple related issues' do - it 'moves all related issues and retains permissions' do - new_issue = move_service.execute(old_issue, new_project) + context 'when admin mode is enabled', :enable_admin_mode do + it 'moves all related issues and retains permissions' do + new_issue = move_service.execute(old_issue, new_project) + + expect(new_issue.related_issues(admin)) + .to match_array([authorized_issue_b, authorized_issue_c, authorized_issue_d, unauthorized_issue]) + + expect(new_issue.related_issues(user)) + .to match_array([authorized_issue_b, authorized_issue_c, authorized_issue_d]) + + expect(authorized_issue_d.related_issues(user)) + .to match_array([new_issue]) + end + end - expect(new_issue.related_issues(admin)) - .to match_array([authorized_issue_b, authorized_issue_c, authorized_issue_d, unauthorized_issue]) + context 'when admin mode is disabled' do + it 'moves all related issues and retains permissions' do + new_issue = move_service.execute(old_issue, new_project) - expect(new_issue.related_issues(user)) - .to match_array([authorized_issue_b, authorized_issue_c, authorized_issue_d]) + expect(new_issue.related_issues(admin)) + .to match_array([authorized_issue_b, authorized_issue_c, authorized_issue_d]) - expect(authorized_issue_d.related_issues(user)) - .to match_array([new_issue]) + expect(new_issue.related_issues(user)) + .to match_array([authorized_issue_b, authorized_issue_c, authorized_issue_d]) + + expect(authorized_issue_d.related_issues(user)) + .to match_array([new_issue]) + end end end end |