diff options
author | Nick Thomas <nick@gitlab.com> | 2016-08-12 22:54:32 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-08-12 22:54:32 +0100 |
commit | 59bfa0809822c3dd257748197223809922ab5f80 (patch) | |
tree | 8c5d247402532e0995f7f9f25203c6e787c3ed74 /spec/services/issues | |
parent | b2828d4145ac01468a59b821ced29dd248526089 (diff) | |
download | gitlab-ce-59bfa0809822c3dd257748197223809922ab5f80.tar.gz |
Send notification emails when users are newly mentioned in issue edits
Diffstat (limited to 'spec/services/issues')
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 088c3d48bf7..a5e375578ec 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -319,5 +319,38 @@ describe Issues::UpdateService, services: true do end 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_issue(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_issue(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 end end |