gitlab-org--gitlab-foss/spec/mailers/ci/notify_spec.rb

36 lines
816 B
Ruby
Raw Normal View History

2015-08-25 21:42:46 -04:00
require 'spec_helper'
2015-09-15 09:00:45 -04:00
describe Ci::Notify do
2015-08-25 21:42:46 -04:00
include EmailSpec::Helpers
include EmailSpec::Matchers
before do
2015-09-28 07:14:34 -04:00
@commit = FactoryGirl.create :ci_commit
2015-09-15 09:00:45 -04:00
@build = FactoryGirl.create :ci_build, commit: @commit
2015-08-25 21:42:46 -04:00
end
describe 'build success' do
2015-09-15 09:00:45 -04:00
subject { Ci::Notify.build_success_email(@build.id, 'wow@example.com') }
2015-08-25 21:42:46 -04:00
it 'has the correct subject' do
should have_subject /Build success for/
end
it 'contains name of project' do
should have_body_text /build successful/
end
end
describe 'build fail' do
2015-09-15 09:00:45 -04:00
subject { Ci::Notify.build_fail_email(@build.id, 'wow@example.com') }
2015-08-25 21:42:46 -04:00
it 'has the correct subject' do
should have_subject /Build failed for/
end
it 'contains name of project' do
should have_body_text /build failed/
end
end
end