diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-04-30 00:06:22 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-05-18 05:53:03 +0300 |
commit | 07ff874f572a947d7730787492a604dd3f44d496 (patch) | |
tree | e2182144eaeadbc54d408df9168f3ef220d16f27 /spec/services | |
parent | 98d88e8188f551533390ca9dcb1247e5af6807cf (diff) |
Let users set notification levels in projects which they are not members
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/merge_requests/update_service_spec.rb | 1 | ||||
-rw-r--r-- | spec/services/notification_service_spec.rb | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb index 213e8c2eb3a..e872fc0eed2 100644 --- a/spec/services/merge_requests/update_service_spec.rb +++ b/spec/services/merge_requests/update_service_spec.rb @@ -17,6 +17,7 @@ describe MergeRequests::UpdateService, services: true do before do project.team << [user, :master] project.team << [user2, :developer] + project.team << [user3, :developer] end describe 'execute' do diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 4bbc4ddc3ab..d557b2e65b8 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -119,7 +119,10 @@ describe NotificationService, services: true do let(:note) { create(:note_on_issue, noteable: confidential_issue, project: project, note: "#{author.to_reference} #{assignee.to_reference} #{non_member.to_reference} #{member.to_reference} #{admin.to_reference}") } it 'filters out users that can not read the issue' do + project.team << [admin, :master] + project.team << [author, :developer] project.team << [member, :developer] + project.team << [assignee, :developer] expect(SentNotification).to receive(:record).with(confidential_issue, any_args).exactly(4).times @@ -143,7 +146,8 @@ describe NotificationService, services: true do before do build_team(note.project) - note.project.team << [note.author, :master] + note.project.team << [[note.author, note.noteable.author, note.noteable.assignee], :master] + ActionMailer::Base.deliveries.clear end @@ -260,6 +264,7 @@ describe NotificationService, services: true do before do build_team(issue.project) add_users_with_subscription(issue.project, issue) + project.team << [[issue.assignee, issue.author], :developer] ActionMailer::Base.deliveries.clear end @@ -491,6 +496,7 @@ describe NotificationService, services: true do before do build_team(merge_request.target_project) add_users_with_subscription(merge_request.target_project, merge_request) + project.team << [merge_request.assignee, :developer] ActionMailer::Base.deliveries.clear end |