Add tests for key/deploy key notifications
This commit is contained in:
parent
a41ee7eb5e
commit
428061678e
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue