Commit 02b5d359 authored by http://jneen.net/'s avatar http://jneen.net/

restructure the #new_key notification spec

parent 8f6205d1
...@@ -80,21 +80,16 @@ describe NotificationService, :mailer do ...@@ -80,21 +80,16 @@ describe NotificationService, :mailer do
describe 'Keys' do describe 'Keys' do
describe '#new_key' do describe '#new_key' do
let!(:key) { create(:personal_key) } let(:key_options) { {} }
let!(:key) { create(:personal_key, key_options) }
it { expect(notification.new_key(key)).to be_truthy } it { expect(notification.new_key(key)).to be_truthy }
it { should_email(key.user) }
it 'sends email to key owner' do describe 'never emails the ghost user' do
expect { notification.new_key(key) }.to change { ActionMailer::Base.deliveries.size }.by(1) let(:key_options) { { user: User.ghost } }
end
it 'never emails the ghost user' do
key.user = User.ghost
reset_delivered_emails!
notification.new_key(key)
should_not_email_anyone it { should_not_email_anyone }
end end
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