summaryrefslogtreecommitdiff
path: root/spec/mailers/notify_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mailers/notify_spec.rb')
-rw-r--r--spec/mailers/notify_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 27e509933b2..154901a2fbc 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -13,6 +13,7 @@ describe Notify do
let(:gitlab_sender_reply_to) { Gitlab.config.gitlab.email_reply_to }
let(:recipient) { create(:user, email: 'recipient@example.com') }
let(:project) { create(:project) }
+ let(:build) { create(:ci_build) }
before(:each) do
ActionMailer::Base.deliveries.clear
@@ -865,4 +866,32 @@ describe Notify do
is_expected.to have_body_text /#{diff_path}/
end
end
+
+ describe 'build success' do
+ before { build.success }
+
+ subject { Notify.build_success_email(build.id, 'wow@example.com') }
+
+ it 'has the correct subject' do
+ should have_subject /Build success for/
+ end
+
+ it 'contains name of project' do
+ should have_body_text build.project_name
+ end
+ end
+
+ describe 'build fail' do
+ before { build.drop }
+
+ subject { Notify.build_fail_email(build.id, 'wow@example.com') }
+
+ it 'has the correct subject' do
+ should have_subject /Build failed for/
+ end
+
+ it 'contains name of project' do
+ should have_body_text build.project_name
+ end
+ end
end