##// END OF EJS Templates
Fixed some tests that where looking for specific issue urls but weren't matching...
Eric Davis -
r2935:b2e4d8ad3f36
parent child
Show More
@@ -135,7 +135,7 RAW
135 135
136 136 def test_redmine_links
137 137 issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3},
138 :class => 'issue', :title => 'Error 281 when updating a recipe (New)')
138 :class => 'issue status-1 priority-1 overdue', :title => 'Error 281 when updating a recipe (New)')
139 139
140 140 changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1},
141 141 :class => 'changeset', :title => 'My very first commit')
@@ -19,6 +19,7 require File.dirname(__FILE__) + '/../test_helper'
19 19
20 20 class MailerTest < ActiveSupport::TestCase
21 21 include Redmine::I18n
22 include ActionController::Assertions::SelectorAssertions
22 23 fixtures :projects, :issues, :users, :members, :member_roles, :documents, :attachments, :news, :tokens, :journals, :journal_details, :changesets, :trackers, :issue_statuses, :enumerations, :messages, :boards, :repositories
23 24
24 25 def test_generated_links_in_emails
@@ -31,13 +32,15 class MailerTest < ActiveSupport::TestCase
31 32
32 33 mail = ActionMailer::Base.deliveries.last
33 34 assert_kind_of TMail::Mail, mail
34 # link to the main ticket
35 assert mail.body.include?('<a href="https://mydomain.foo/issues/1">Bug #1: Can\'t print recipes</a>')
36 35
36 assert_select_email do
37 # link to the main ticket
38 assert_select "a[href=?]", "https://mydomain.foo/issues/1", :text => "Bug #1: Can't print recipes"
37 39 # link to a referenced ticket
38 assert mail.body.include?('<a href="https://mydomain.foo/issues/2" class="issue" title="Add ingredients categories (Assigned)">#2</a>')
40 assert_select "a[href=?][title=?]", "https://mydomain.foo/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
39 41 # link to a changeset
40 assert mail.body.include?('<a href="https://mydomain.foo/projects/ecookbook/repository/revisions/2" class="changeset" title="This commit fixes #1, #2 and references #1 &amp; #3">r2</a>')
42 assert_select "a[href=?][title=?]", "https://mydomain.foo/projects/ecookbook/repository/revisions/2", "This commit fixes #1, #2 and references #1 &amp; #3", :text => "r2"
43 end
41 44 end
42 45
43 46 def test_generated_links_with_prefix
@@ -52,13 +55,15 class MailerTest < ActiveSupport::TestCase
52 55
53 56 mail = ActionMailer::Base.deliveries.last
54 57 assert_kind_of TMail::Mail, mail
55 # link to the main ticket
56 assert mail.body.include?('<a href="http://mydomain.foo/rdm/issues/1">Bug #1: Can\'t print recipes</a>')
57 58
59 assert_select_email do
60 # link to the main ticket
61 assert_select "a[href=?]", "http://mydomain.foo/rdm/issues/1", :text => "Bug #1: Can't print recipes"
58 62 # link to a referenced ticket
59 assert mail.body.include?('<a href="http://mydomain.foo/rdm/issues/2" class="issue" title="Add ingredients categories (Assigned)">#2</a>')
63 assert_select "a[href=?][title=?]", "http://mydomain.foo/rdm/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
60 64 # link to a changeset
61 assert mail.body.include?('<a href="http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2" class="changeset" title="This commit fixes #1, #2 and references #1 &amp; #3">r2</a>')
65 assert_select "a[href=?][title=?]", "http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2", "This commit fixes #1, #2 and references #1 &amp; #3", :text => "r2"
66 end
62 67 ensure
63 68 # restore it
64 69 Redmine::Utils.relative_url_root = relative_url_root
@@ -76,13 +81,15 class MailerTest < ActiveSupport::TestCase
76 81
77 82 mail = ActionMailer::Base.deliveries.last
78 83 assert_kind_of TMail::Mail, mail
79 # link to the main ticket
80 assert mail.body.include?('<a href="http://mydomain.foo/rdm/issues/1">Bug #1: Can\'t print recipes</a>')
81 84
85 assert_select_email do
86 # link to the main ticket
87 assert_select "a[href=?]", "http://mydomain.foo/rdm/issues/1", :text => "Bug #1: Can't print recipes"
82 88 # link to a referenced ticket
83 assert mail.body.include?('<a href="http://mydomain.foo/rdm/issues/2" class="issue" title="Add ingredients categories (Assigned)">#2</a>')
89 assert_select "a[href=?][title=?]", "http://mydomain.foo/rdm/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
84 90 # link to a changeset
85 assert mail.body.include?('<a href="http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2" class="changeset" title="This commit fixes #1, #2 and references #1 &amp; #3">r2</a>')
91 assert_select "a[href=?][title=?]", "http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2", "This commit fixes #1, #2 and references #1 &amp; #3", :text => "r2"
92 end
86 93 ensure
87 94 # restore it
88 95 Redmine::Utils.relative_url_root = relative_url_root
General Comments 0
You need to be logged in to leave comments. Login now