diff options
author | Nick Thomas <nick@gitlab.com> | 2016-08-15 16:47:16 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-08-15 16:47:16 +0300 |
commit | 6642ae4579d6ceed6b26014aee4a22adb39fc43c (patch) | |
tree | f22f9704185059cfd49e65488bdb44174fce478d /spec/services/merge_requests/update_service_spec.rb | |
parent | b450aab8501076740cd7140b47488b9dfa5f58f9 (diff) |
Add notifications for new user mentions in merge requests
Diffstat (limited to 'spec/services/merge_requests/update_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/update_service_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb index 283a336afd9..e26e925cd81 100644 --- a/spec/services/merge_requests/update_service_spec.rb +++ b/spec/services/merge_requests/update_service_spec.rb @@ -226,6 +226,39 @@ describe MergeRequests::UpdateService, services: true do end end + context 'updated user mentions' do + let(:user4) { create(:user) } + before do + project.team << [user4, :developer] + end + + context "in title" do + before do + perform_enqueued_jobs { update_merge_request(title: user4.to_reference) } + end + + it "should email only the newly-mentioned user" do + should_not_email(user) + should_not_email(user2) + should_not_email(user3) + should_email(user4) + end + end + + context "in description" do + before do + perform_enqueued_jobs { update_merge_request(description: user4.to_reference) } + end + + it "should email only the newly-mentioned user" do + should_not_email(user) + should_not_email(user2) + should_not_email(user3) + should_email(user4) + end + end + end + context 'when MergeRequest has tasks' do before { update_merge_request({ description: "- [ ] Task 1\n- [ ] Task 2" }) } |