bb5f79d43e
`:mailer` is needed to pick it easily, while `type: :mailer` is needed for picking it automatically for tests located in spec/mailers/*_spec.rb It's a bit complicated in spec/services/notification_service_spec.rb but we'll leave it alone for now.
20 lines
429 B
Ruby
20 lines
429 B
Ruby
require 'spec_helper'
|
|
|
|
describe DeployKey, :mailer do
|
|
describe "Associations" 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
|