| |   |
| 40 | 40 | |
| 41 | 41 | def added_as_committer(repository, user) |
| 42 | 42 | setup_email(user) |
| 43 | | @subject += "You are now a committer on #{repository.project.slug}/#{repository.parent.name}" |
| 43 | @subject += "You are now a committer on #{repository.project.slug}/#{repository.name}" |
| 44 | 44 | @body[:repository] = repository |
| 45 | 45 | @body[:project] = repository.project |
| 46 | 46 | @body[:url] = "http://#{GitoriousConfig['gitorious_host']}/p/#{repository.project.slug}/repos/#{repository.name}" |
| toggle raw diff |
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -40,7 +40,7 @@ class Mailer < ActionMailer::Base
def added_as_committer(repository, user)
setup_email(user)
- @subject += "You are now a committer on #{repository.project.slug}/#{repository.parent.name}"
+ @subject += "You are now a committer on #{repository.project.slug}/#{repository.name}"
@body[:repository] = repository
@body[:project] = repository.project
@body[:url] = "http://#{GitoriousConfig['gitorious_host']}/p/#{repository.project.slug}/repos/#{repository.name}" |
| |   |
| 69 | 69 | Mailer.deliver(mail) |
| 70 | 70 | Mailer.deliveries.should == [mail] |
| 71 | 71 | end |
| 72 | |
| 73 | it "sends added_as_committer" do |
| 74 | user = users(:johan) |
| 75 | repos = repositories(:johans2) |
| 76 | mail = Mailer.create_added_as_committer(repos,user) |
| 77 | |
| 78 | mail.to.should == [user.email] |
| 79 | mail.subject.should == "[Gitorious] You are now a committer on #{repos.project.slug}/#{repos.name}" |
| 80 | mail.body.should match(/you have been added as a committer on the #{repos.name} in the #{repos.project.title} project/i) |
| 81 | |
| 82 | Mailer.deliver(mail) |
| 83 | Mailer.deliveries.should == [mail] |
| 84 | end |
| 72 | 85 | |
| 73 | 86 | end |
| toggle raw diff |
--- a/spec/models/mailer_spec.rb
+++ b/spec/models/mailer_spec.rb
@@ -69,5 +69,18 @@ describe Mailer do
Mailer.deliver(mail)
Mailer.deliveries.should == [mail]
end
+
+ it "sends added_as_committer" do
+ user = users(:johan)
+ repos = repositories(:johans2)
+ mail = Mailer.create_added_as_committer(repos,user)
+
+ mail.to.should == [user.email]
+ mail.subject.should == "[Gitorious] You are now a committer on #{repos.project.slug}/#{repos.name}"
+ mail.body.should match(/you have been added as a committer on the #{repos.name} in the #{repos.project.title} project/i)
+
+ Mailer.deliver(mail)
+ Mailer.deliveries.should == [mail]
+ end
end |