summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-08-05 17:08:26 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-08-05 17:08:26 +0000
commitfd1b0607055909142e75f437a326273c3bd370e5 (patch)
tree60d53cd94e140f08072ba2c09ffe9dbd4e9e858e /test
parentb19b90234529206205abfa21c4a92ba7cebb7d98 (diff)
downloadredmine-fd1b0607055909142e75f437a326273c3bd370e5.tar.gz
redmine-fd1b0607055909142e75f437a326273c3bd370e5.zip
Fixed that standard fields disabled still appear in email notifications (#14584).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12079 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/mailer_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb
index 3cacf4f87..a2f371632 100644
--- a/test/unit/mailer_test.rb
+++ b/test/unit/mailer_test.rb
@@ -317,6 +317,29 @@ class MailerTest < ActiveSupport::TestCase
assert !last_email.bcc.include?(user.mail)
end
+ def test_issue_add_should_include_enabled_fields
+ Setting.default_language = 'en'
+ issue = Issue.find(2)
+ assert Mailer.deliver_issue_add(issue)
+ assert_mail_body_match '* Target version: 1.0', last_email
+ assert_select_email do
+ assert_select 'li', :text => 'Target version: 1.0'
+ end
+ end
+
+ def test_issue_add_should_not_include_disabled_fields
+ Setting.default_language = 'en'
+ issue = Issue.find(2)
+ tracker = issue.tracker
+ tracker.core_fields -= ['fixed_version_id']
+ tracker.save!
+ assert Mailer.deliver_issue_add(issue)
+ assert_mail_body_no_match 'Target version', last_email
+ assert_select_email do
+ assert_select 'li', :text => /Target version/, :count => 0
+ end
+ end
+
# test mailer methods for each language
def test_issue_add
issue = Issue.find(1)