Removing shoulda context.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11315 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-02-03 09:20:05 +00:00
parent de8033d183
commit 14b50dfbab
7 changed files with 412 additions and 524 deletions
+30 -34
View File
@@ -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