Mercurial > hg > soundsoftware-site
comparison test/unit/mailer_test.rb @ 1517:dffacf8a6908 redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:29:00 +0100 |
parents | e248c7af89ec |
children |
comparison
equal
deleted
inserted
replaced
1516:b450a9d58aed | 1517:dffacf8a6908 |
---|---|
53 'https://mydomain.foo/issues/2#change-3', | 53 'https://mydomain.foo/issues/2#change-3', |
54 :text => 'Feature request #2: Add ingredients categories' | 54 :text => 'Feature request #2: Add ingredients categories' |
55 # link to a referenced ticket | 55 # link to a referenced ticket |
56 assert_select 'a[href=?][title=?]', | 56 assert_select 'a[href=?][title=?]', |
57 'https://mydomain.foo/issues/1', | 57 'https://mydomain.foo/issues/1', |
58 'Can't print recipes (New)', | 58 "#{ESCAPED_UCANT} print recipes (New)", |
59 :text => '#1' | 59 :text => '#1' |
60 # link to a changeset | 60 # link to a changeset |
61 assert_select 'a[href=?][title=?]', | 61 assert_select 'a[href=?][title=?]', |
62 'https://mydomain.foo/projects/ecookbook/repository/revisions/2', | 62 'https://mydomain.foo/projects/ecookbook/repository/revisions/2', |
63 'This commit fixes #1, #2 and references #1 & #3', | 63 'This commit fixes #1, #2 and references #1 & #3', |
92 'http://mydomain.foo/rdm/issues/2#change-3', | 92 'http://mydomain.foo/rdm/issues/2#change-3', |
93 :text => 'Feature request #2: Add ingredients categories' | 93 :text => 'Feature request #2: Add ingredients categories' |
94 # link to a referenced ticket | 94 # link to a referenced ticket |
95 assert_select 'a[href=?][title=?]', | 95 assert_select 'a[href=?][title=?]', |
96 'http://mydomain.foo/rdm/issues/1', | 96 'http://mydomain.foo/rdm/issues/1', |
97 'Can't print recipes (New)', | 97 "#{ESCAPED_UCANT} print recipes (New)", |
98 :text => '#1' | 98 :text => '#1' |
99 # link to a changeset | 99 # link to a changeset |
100 assert_select 'a[href=?][title=?]', | 100 assert_select 'a[href=?][title=?]', |
101 'http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2', | 101 'http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2', |
102 'This commit fixes #1, #2 and references #1 & #3', | 102 'This commit fixes #1, #2 and references #1 & #3', |
142 'http://mydomain.foo/rdm/issues/2#change-3', | 142 'http://mydomain.foo/rdm/issues/2#change-3', |
143 :text => 'Feature request #2: Add ingredients categories' | 143 :text => 'Feature request #2: Add ingredients categories' |
144 # link to a referenced ticket | 144 # link to a referenced ticket |
145 assert_select 'a[href=?][title=?]', | 145 assert_select 'a[href=?][title=?]', |
146 'http://mydomain.foo/rdm/issues/1', | 146 'http://mydomain.foo/rdm/issues/1', |
147 'Can't print recipes (New)', | 147 "#{ESCAPED_UCANT} print recipes (New)", |
148 :text => '#1' | 148 :text => '#1' |
149 # link to a changeset | 149 # link to a changeset |
150 assert_select 'a[href=?][title=?]', | 150 assert_select 'a[href=?][title=?]', |
151 'http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2', | 151 'http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2', |
152 'This commit fixes #1, #2 and references #1 & #3', | 152 'This commit fixes #1, #2 and references #1 & #3', |
463 news = News.first | 463 news = News.first |
464 valid_languages.each do |lang| | 464 valid_languages.each do |lang| |
465 Setting.default_language = lang.to_s | 465 Setting.default_language = lang.to_s |
466 assert Mailer.news_added(news).deliver | 466 assert Mailer.news_added(news).deliver |
467 end | 467 end |
468 end | |
469 | |
470 def test_news_added_should_notify_project_news_watchers | |
471 user1 = User.generate! | |
472 user2 = User.generate! | |
473 news = News.find(1) | |
474 news.project.enabled_module('news').add_watcher(user1) | |
475 | |
476 Mailer.news_added(news).deliver | |
477 assert_include user1.mail, last_email.bcc | |
478 assert_not_include user2.mail, last_email.bcc | |
468 end | 479 end |
469 | 480 |
470 def test_news_comment_added | 481 def test_news_comment_added |
471 comment = Comment.find(2) | 482 comment = Comment.find(2) |
472 valid_languages.each do |lang| | 483 valid_languages.each do |lang| |
637 assert ActionMailer::Base.deliveries.empty? | 648 assert ActionMailer::Base.deliveries.empty? |
638 # should restore perform_deliveries | 649 # should restore perform_deliveries |
639 assert ActionMailer::Base.perform_deliveries | 650 assert ActionMailer::Base.perform_deliveries |
640 end | 651 end |
641 | 652 |
653 def test_token_for_should_strip_trailing_gt_from_address_with_full_name | |
654 with_settings :mail_from => "Redmine Mailer<no-reply@redmine.org>" do | |
655 assert_match /\Aredmine.issue-\d+\.\d+\.[0-9a-f]+@redmine.org\z/, Mailer.token_for(Issue.generate!) | |
656 end | |
657 end | |
658 | |
642 def test_layout_should_include_the_emails_header | 659 def test_layout_should_include_the_emails_header |
643 with_settings :emails_header => "*Header content*" do | 660 with_settings :emails_header => "*Header content*" do |
644 with_settings :plain_text_mail => 0 do | 661 with_settings :plain_text_mail => 0 do |
645 assert Mailer.test_email(User.find(1)).deliver | 662 assert Mailer.test_email(User.find(1)).deliver |
646 assert_select_email do | 663 assert_select_email do |