Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mailers/notify_spec.rb')
-rw-r--r--spec/mailers/notify_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 94c4f43d823..7867c4dd78e 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -70,6 +70,28 @@ describe Notify do
end
end
+ describe 'user added ssh key' do
+ let(:key) { create(:personal_key) }
+
+ subject { Notify.new_ssh_key_email(key.id) }
+
+ it 'is sent to the new user' do
+ should deliver_to key.user.email
+ end
+
+ it 'has the correct subject' do
+ should have_subject /^gitlab \| SSH key was added to your account$/i
+ end
+
+ it 'contains the new ssh key title' do
+ should have_body_text /#{key.title}/
+ end
+
+ it 'includes a link to ssh keys page' do
+ should have_body_text /#{keys_path}/
+ end
+ end
+
context 'for a project' do
describe 'items that are assignable, the email' do
let(:assignee) { create(:user, email: 'assignee@example.com') }