diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-03 09:20:05 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-02-03 09:20:05 +0000 |
commit | 14b50dfbabc6b64856ac3511260b787aaf733105 (patch) | |
tree | f542733f7cc60e6bd6964989100c8c0d3892e97f /test/unit/mailer_test.rb | |
parent | de8033d18316f2b8fa65b556e36bd74ee9d5f566 (diff) | |
download | redmine-14b50dfbabc6b64856ac3511260b787aaf733105.tar.gz redmine-14b50dfbabc6b64856ac3511260b787aaf733105.zip |
Removing shoulda context.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11315 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/mailer_test.rb')
-rw-r--r-- | test/unit/mailer_test.rb | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 90dca587b..223422002 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -279,44 +279,40 @@ class MailerTest < ActiveSupport::TestCase end end - context("#issue_add") do - setup do - ActionMailer::Base.deliveries.clear - Setting.bcc_recipients = '1' - @issue = Issue.find(1) - end + test "#issue_add should notify project members" do + issue = Issue.find(1) + assert Mailer.issue_add(issue).deliver + assert last_email.bcc.include?('dlopper@somenet.foo') + end - should "notify project members" do - assert Mailer.issue_add(@issue).deliver - assert last_email.bcc.include?('dlopper@somenet.foo') - end + test "#issue_add should not notify project members that are not allow to view the issue" do + issue = Issue.find(1) + Role.find(2).remove_permission!(:view_issues) + assert Mailer.issue_add(issue).deliver + assert !last_email.bcc.include?('dlopper@somenet.foo') + end - should "not notify project members that are not allow to view the issue" do - Role.find(2).remove_permission!(:view_issues) - assert Mailer.issue_add(@issue).deliver - assert !last_email.bcc.include?('dlopper@somenet.foo') - end + test "#issue_add should notify issue watchers" do + issue = Issue.find(1) + user = User.find(9) + # minimal email notification options + user.pref[:no_self_notified] = '1' + user.pref.save + user.mail_notification = false + user.save - should "notify issue watchers" do - user = User.find(9) - # minimal email notification options - user.pref[:no_self_notified] = '1' - user.pref.save - user.mail_notification = false - user.save - - Watcher.create!(:watchable => @issue, :user => user) - assert Mailer.issue_add(@issue).deliver - assert last_email.bcc.include?(user.mail) - end + Watcher.create!(:watchable => issue, :user => user) + assert Mailer.issue_add(issue).deliver + assert last_email.bcc.include?(user.mail) + end - should "not notify watchers not allowed to view the issue" do - user = User.find(9) - Watcher.create!(:watchable => @issue, :user => user) - Role.non_member.remove_permission!(:view_issues) - assert Mailer.issue_add(@issue).deliver - assert !last_email.bcc.include?(user.mail) - end + test "#issue_add should not notify watchers not allowed to view the issue" do + issue = Issue.find(1) + user = User.find(9) + Watcher.create!(:watchable => issue, :user => user) + Role.non_member.remove_permission!(:view_issues) + assert Mailer.issue_add(issue).deliver + assert !last_email.bcc.include?(user.mail) end # test mailer methods for each language |