Add tests for key/deploy key notifications

This commit is contained in:
Lin Jen-Shin 2016-11-18 19:09:03 +08:00
parent a41ee7eb5e
commit 428061678e
2 changed files with 24 additions and 0 deletions

View File

@ -5,4 +5,16 @@ describe DeployKey, models: true do
it { is_expected.to have_many(:deploy_keys_projects) }
it { is_expected.to have_many(:projects) }
end
describe 'notification' do
let(:user) { create(:user) }
it 'does not send a notification' do
perform_enqueued_jobs do
create(:deploy_key, user: user)
end
should_not_email(user)
end
end
end

View File

@ -92,4 +92,16 @@ describe Key, models: true do
expect(described_class.new(key: " #{valid_key} ").key).to eq(valid_key)
end
end
describe 'notification' do
let(:user) { create(:user) }
it 'sends a notification' do
perform_enqueued_jobs do
create(:key, user: user)
end
should_email(user)
end
end
end