From a3cdaeef6654edac27a07fac8189c581977827e5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 19 Mar 2013 20:00:41 +0200 Subject: refactor emails a bit. Add email on ssh key creation --- spec/mailers/notify_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'spec') 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') } -- cgit v1.2.3