diff options
author | Alex Denisov <1101.debian@gmail.com> | 2012-08-27 01:13:03 +0400 |
---|---|---|
committer | Alex Denisov <1101.debian@gmail.com> | 2012-08-27 01:13:03 +0400 |
commit | aaeb37419ac00ed065f1c88f617db5788ada8525 (patch) | |
tree | 9ed94522c1418bf58662aa56439ca9693a53c446 /spec/mailers | |
parent | 2c32574ac303e180f43cfc2a3d119dd6a7b29b0c (diff) |
Send notifiation on create UserProject relation (access granted)
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/notify_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 93427ebfacd..60f3231ce91 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -145,6 +145,26 @@ describe Notify do end end + describe 'project access changed' do + let(:project) { Factory.create(:project, + path: "Fuu", + code: "Fuu") } + let(:user) { Factory.create :user } + let(:users_project) { Factory.create(:users_project, + project: project, + user: user) } + subject { Notify.project_access_granted_email(users_project.id) } + it 'has the correct subject' do + should have_subject /access to project was granted/ + end + it 'contains name of project' do + should have_body_text /#{project.name}/ + end + it 'contains new user role' do + should have_body_text /#{users_project.project_access_human}/ + end + end + context 'items that are noteable, the email for a note' do let(:note_author) { Factory.create(:user, name: 'author_name') } let(:note) { Factory.create(:note, project: project, author: note_author) } |