diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-09 15:17:16 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-09 15:17:16 +0300 |
commit | cc4ef4da11d46761ab0ce4fbd6b032a7e01baba9 (patch) | |
tree | 2ed2caa8a9c1202148b5bed477e4c50ee09a3fd7 /spec/mailers | |
parent | 76c6aeb9bc9855e9a65bb08db862e92ac923255e (diff) |
Refactor CI tests
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/ci/notify_spec.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/mailers/ci/notify_spec.rb b/spec/mailers/ci/notify_spec.rb new file mode 100644 index 00000000000..6a2c845cd0e --- /dev/null +++ b/spec/mailers/ci/notify_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe Notify do + include EmailSpec::Helpers + include EmailSpec::Matchers + + before do + @project = FactoryGirl.create :project + @commit = FactoryGirl.create :commit, project: @project + @build = FactoryGirl.create :build, commit: @commit + end + + describe 'build success' do + 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 successful/ + end + end + + describe 'build fail' do + 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 failed/ + end + end +end |