summaryrefslogtreecommitdiff
path: root/spec/services/notification_service_spec.rb
diff options
context:
space:
mode:
authorlulalala <mark@goodlife.tw>2018-05-09 17:49:33 +0800
committerMark Chao <mchao@gitlab.com>2018-05-17 08:54:51 +0800
commitdc174e9655267e89e1b7c63f8c9f4dac069069c7 (patch)
tree33cebe2481870434098f88f253090f2de91b873d /spec/services/notification_service_spec.rb
parent179a1ee7c669e758f8dc9fb5e9c8f2563012a6e1 (diff)
downloadgitlab-ce-dc174e9655267e89e1b7c63f8c9f4dac069069c7.tar.gz
Notify with email when merge request became unmergeable
Display MR unmergeable reasons
Diffstat (limited to 'spec/services/notification_service_spec.rb')
-rw-r--r--spec/services/notification_service_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index 5f28bc123f3..831678b949d 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -1224,6 +1224,32 @@ describe NotificationService, :mailer do
end
end
+ describe '#merge_request_unmergeable' do
+ it "sends email to merge request author" do
+ notification.merge_request_unmergeable(merge_request)
+
+ should_email(merge_request.author)
+ expect(email_recipients.size).to eq(1)
+ end
+
+ describe 'when merge_when_pipeline_succeeds is true' do
+ before do
+ merge_request.update_attributes(
+ merge_when_pipeline_succeeds: true,
+ merge_user: create(:user)
+ )
+ end
+
+ it "sends email to merge request author and merge_user" do
+ notification.merge_request_unmergeable(merge_request)
+
+ should_email(merge_request.author)
+ should_email(merge_request.merge_user)
+ expect(email_recipients.size).to eq(2)
+ end
+ end
+ end
+
describe '#closed_merge_request' do
before do
update_custom_notification(:close_merge_request, @u_guest_custom, resource: project)