summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-10-02 14:55:21 +0200
committerRobert Speicher <rspeicher@gmail.com>2016-10-02 14:55:21 +0200
commit9dd50b57ecb11b05db752c95a62d08f837ce46fd (patch)
tree501e0281e3cc097c8bd701a608810ce659969933 /spec
parente64594ac4419a42b84f3ee36388f832e74361c8c (diff)
parent6e6f34bffb641ae698177055b8f3528ec41fb7c8 (diff)
downloadgitlab-ce-9dd50b57ecb11b05db752c95a62d08f837ce46fd.tar.gz
Merge branch 'jimmykarily/gitlab-ce-notify_current_user_when_merging_an_mr_after_build_succeeds' into 'master'
Notify current_user about automatic merge after successful build It enables notifications to the initiator of a merge when the MR is flagged as "Merge when build succeeds". Because when running Builds, quite some time passes between the user's action and the actual Merge so it is a good thing to notify the initiator of the Merge when it actually happens. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/14409 See merge request !6534
Diffstat (limited to 'spec')
-rw-r--r--spec/services/notification_service_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index 0d152534c38..d820646ebdf 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -962,6 +962,20 @@ describe NotificationService, services: true do
should_not_email(@u_lazy_participant)
end
+ it "notifies the merger when merge_when_build_succeeds is true" do
+ merge_request.merge_when_build_succeeds = true
+ notification.merge_mr(merge_request, @u_watcher)
+
+ should_email(@u_watcher)
+ end
+
+ it "does not notify the merger when merge_when_build_succeeds is false" do
+ merge_request.merge_when_build_succeeds = false
+ notification.merge_mr(merge_request, @u_watcher)
+
+ should_not_email(@u_watcher)
+ end
+
context 'participating' do
context 'by assignee' do
before do