diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index b6110da83b5..bed74b4a900 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -87,6 +87,14 @@ describe NotificationService, :mailer do it 'sends email to key owner' do expect { notification.new_key(key) }.to change { ActionMailer::Base.deliveries.size }.by(1) end + + it 'never emails the ghost user' do + key.user = User.ghost + + notification.new_key(key) + + should_not_email_anyone + end end end