summaryrefslogtreecommitdiff
path: root/spec/mailers
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-19 20:00:41 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-19 20:00:41 +0200
commita3cdaeef6654edac27a07fac8189c581977827e5 (patch)
tree4b73e8662e5e03bbe19d2cf3ebb7db4b50f5ec55 /spec/mailers
parent52d3fa191f570ddfad4549e848f45d90327e3df6 (diff)
downloadgitlab-ce-a3cdaeef6654edac27a07fac8189c581977827e5.tar.gz
refactor emails a bit. Add email on ssh key creation
Diffstat (limited to 'spec/mailers')
-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') }