Commit fc3878c03461a1b75a30332756544b2e10b77917

Authored by Dmitriy Zaporozhets
1 parent 5f85d6d1

Email on push mailer spec

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing 1 changed file with 24 additions and 0 deletions   Show diff stats
spec/mailers/notify_spec.rb
... ... @@ -391,4 +391,28 @@ describe Notify do
391 391 should have_body_text /#{example_site_path}/
392 392 end
393 393 end
  394 +
  395 + describe 'email on push' do
  396 + let(:example_site_path) { root_path }
  397 + let(:user) { create(:user) }
  398 + let(:compare) { Gitlab::Git::Compare.new(project.repository.raw_repository, 'cd5c4bac', 'b1e6a9db') }
  399 +
  400 + subject { Notify.repository_push_email(project.id, 'devs@company.name', user.id, 'master', compare) }
  401 +
  402 + it 'is sent to recipient' do
  403 + should deliver_to 'devs@company.name'
  404 + end
  405 +
  406 + it 'has the correct subject' do
  407 + should have_subject /New push to repository/
  408 + end
  409 +
  410 + it 'includes commits list' do
  411 + should have_body_text /tree css fixes/
  412 + end
  413 +
  414 + it 'includes diffs' do
  415 + should have_body_text /Checkout wiki pages for installation information/
  416 + end
  417 + end
394 418 end
... ...