Commit 93e2e302 authored by Marin Jankovski's avatar Marin Jankovski

Add admin notification spec.

parent 6ea702db
...@@ -622,4 +622,30 @@ describe Notify do ...@@ -622,4 +622,30 @@ describe Notify do
should have_body_text /#{diff_path}/ should have_body_text /#{diff_path}/
end end
end end
describe 'admin notification' do
let(:example_site_path) { root_path }
let(:user) { create(:user) }
subject { @email = Notify.send_admin_notification(user.id, 'Admin announcement','Text') }
it 'is sent as the author' do
sender = subject.header[:from].addrs[0]
sender.display_name.should eq("GitLab")
sender.address.should eq(gitlab_sender)
end
it 'is sent to recipient' do
should deliver_to user.email
end
it 'has the correct subject' do
should have_subject 'Admin announcement'
end
it 'includes unsubscribe link' do
unsubscribe_link = "http://localhost/unsubscribes/#{CGI.escape(user.email)}"
should have_body_text(unsubscribe_link)
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment