Commit 42806167 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Add tests for key/deploy key notifications

parent a41ee7eb
...@@ -5,4 +5,16 @@ describe DeployKey, models: true do ...@@ -5,4 +5,16 @@ describe DeployKey, models: true do
it { is_expected.to have_many(:deploy_keys_projects) } it { is_expected.to have_many(:deploy_keys_projects) }
it { is_expected.to have_many(:projects) } it { is_expected.to have_many(:projects) }
end 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 end
...@@ -92,4 +92,16 @@ describe Key, models: true do ...@@ -92,4 +92,16 @@ describe Key, models: true do
expect(described_class.new(key: " #{valid_key} ").key).to eq(valid_key) expect(described_class.new(key: " #{valid_key} ").key).to eq(valid_key)
end end
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 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