Adapt tests for escaping of ' introduced in 8e417fd

This commit is contained in:
Holger Just 2013-01-06 21:16:57 +01:00
parent cdad6f752a
commit c80591fe57
7 changed files with 20 additions and 20 deletions

View File

@ -29,7 +29,7 @@ class ActivitiesControllerTest < ActionController::TestCase
:child => { :tag => "dt",
:attributes => { :class => /issue/ },
:child => { :tag => "a",
:content => /(#{IssueStatus.find(2).name})/,
:content => /(#{ERB::Util.h IssueStatus.find(2).name})/,
}
}
}
@ -47,7 +47,7 @@ class ActivitiesControllerTest < ActionController::TestCase
:child => { :tag => "dt",
:attributes => { :class => /issue/ },
:child => { :tag => "a",
:content => /#{Issue.find(1).subject}/,
:content => /#{ERB::Util.h Issue.find(1).subject}/,
}
}
}
@ -65,7 +65,7 @@ class ActivitiesControllerTest < ActionController::TestCase
:child => { :tag => "dt",
:attributes => { :class => /issue/ },
:child => { :tag => "a",
:content => /#{Issue.find(1).subject}/,
:content => /#{ERB::Util.h Issue.find(1).subject}/,
}
}
}
@ -83,7 +83,7 @@ class ActivitiesControllerTest < ActionController::TestCase
:child => { :tag => "dt",
:attributes => { :class => /issue/ },
:child => { :tag => "a",
:content => /#{Issue.find(1).subject}/,
:content => /#{ERB::Util.h Issue.find(1).subject}/,
}
}
}

View File

@ -56,7 +56,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_template 'index.rhtml'
assert_not_nil assigns(:issues)
assert_nil assigns(:project)
assert_tag :tag => 'a', :content => /Can't print recipes/
assert_tag :tag => 'a', :content => /Can&#39;t print recipes/
assert_tag :tag => 'a', :content => /Subproject issue/
# private projects hidden
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
@ -72,7 +72,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_template 'index.rhtml'
assert_not_nil assigns(:issues)
assert_nil assigns(:project)
assert_no_tag :tag => 'a', :content => /Can't print recipes/
assert_no_tag :tag => 'a', :content => /Can&#39;t print recipes/
assert_tag :tag => 'a', :content => /Subproject issue/
end
@ -83,7 +83,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_template 'index.rhtml'
assert_not_nil assigns(:issues)
assert_nil assigns(:project)
assert_no_tag :tag => 'a', :content => /Can't print recipes/
assert_no_tag :tag => 'a', :content => /Can&#39;t print recipes/
assert_tag :tag => 'a', :content => /Subproject issue/
end
@ -93,7 +93,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_template 'index.rhtml'
assert_not_nil assigns(:issues)
assert_tag :tag => 'a', :content => /Can't print recipes/
assert_tag :tag => 'a', :content => /Can&#39;t print recipes/
assert_no_tag :tag => 'a', :content => /Subproject issue/
end
@ -103,7 +103,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_template 'index.rhtml'
assert_not_nil assigns(:issues)
assert_tag :tag => 'a', :content => /Can't print recipes/
assert_tag :tag => 'a', :content => /Can&#39;t print recipes/
assert_tag :tag => 'a', :content => /Subproject issue/
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
end
@ -115,7 +115,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_template 'index.rhtml'
assert_not_nil assigns(:issues)
assert_tag :tag => 'a', :content => /Can't print recipes/
assert_tag :tag => 'a', :content => /Can&#39;t print recipes/
assert_tag :tag => 'a', :content => /Subproject issue/
assert_tag :tag => 'a', :content => /Issue of a private subproject/
end
@ -1048,7 +1048,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_template 'edit'
assert_error_tag :descendant => {:content => /Activity can't be blank/}
assert_error_tag :descendant => {:content => /Activity can&#39;t be blank/}
assert_tag :textarea, :attributes => { :name => 'notes' }, :content => notes
assert_tag :input, :attributes => { :name => 'time_entry[hours]', :value => "2z" }
end
@ -1066,8 +1066,8 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
assert_template 'edit'
assert_error_tag :descendant => {:content => /Activity can't be blank/}
assert_error_tag :descendant => {:content => /Hours can't be blank/}
assert_error_tag :descendant => {:content => /Activity can&#39;t be blank/}
assert_error_tag :descendant => {:content => /Hours can&#39;t be blank/}
assert_tag :textarea, :attributes => { :name => 'notes' }, :content => notes
assert_tag :input, :attributes => { :name => 'time_entry[comments]', :value => "this is my comment" }
end

View File

@ -56,6 +56,6 @@ class ApplicationTest < ActionController::IntegrationTest
assert_tag :tag => 'p',
:attributes => {:id => 'errorExplanation'},
:content => "The page you were trying to access doesn't exist or has been removed."
:content => "The page you were trying to access doesn&#39;t exist or has been removed."
end
end

View File

@ -473,7 +473,7 @@ RAW
expected = <<-EXPECTED
<p><a href="/projects/ecookbook/wiki/CookBook_documentation" class="wiki-page">CookBook documentation</a></p>
<p><a href="/issues/1" class="issue status-1 priority-1" title="Can't print recipes (New)">#1</a></p>
<p><a href="/issues/1" class="issue status-1 priority-1" title="Can&#39;t print recipes (New)">#1</a></p>
<pre>
[[CookBook documentation]]

View File

@ -207,7 +207,7 @@ class ChiliProject::LiquidTest < ActionView::TestCase
text = "{% include '<script>alert(\"foo\"):</script>' %}"
formatted = textilizable(text)
assert formatted.include?("No such page '&lt;script&gt;alert(&quot;foo&quot;):&lt;/script&gt;'")
assert_match /No such page &#39;&lt;script&gt;alert\(&quot;foo&quot;\):&lt;\/script&gt;&#39;/, formatted
end
end

View File

@ -497,7 +497,7 @@ class MailHandlerTest < ActiveSupport::TestCase
assert mail.to.include?('jsmith@somenet.foo')
assert mail.subject.include?('Failed email submission: New ticket on a given project')
assert mail.body.include?('There were errors with your email submission')
assert mail.body.include?('Required Custom Field0 can\'t be blank')
assert mail.body.include?('Required Custom Field0 can&#39;t be blank')
end
end

View File

@ -39,7 +39,7 @@ class MailerTest < ActiveSupport::TestCase
assert_select_email do
# link to the main ticket
assert_select "a[href=?]", "https://mydomain.foo/issues/1", :text => "Bug #1: Can't print recipes"
assert_select "a[href=?]", "https://mydomain.foo/issues/1", :text => "Bug #1: Can&#39;t print recipes"
# link to a referenced ticket
assert_select "a[href=?][title=?]", "https://mydomain.foo/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
# link to a changeset
@ -61,7 +61,7 @@ class MailerTest < ActiveSupport::TestCase
assert_select_email do
# link to the main ticket
assert_select "a[href=?]", "http://mydomain.foo/rdm/issues/1", :text => "Bug #1: Can't print recipes"
assert_select "a[href=?]", "http://mydomain.foo/rdm/issues/1", :text => "Bug #1: Can&#39;t print recipes"
# link to a referenced ticket
assert_select "a[href=?][title=?]", "http://mydomain.foo/rdm/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
# link to a changeset
@ -86,7 +86,7 @@ class MailerTest < ActiveSupport::TestCase
assert_select_email do
# link to the main ticket
assert_select "a[href=?]", "http://mydomain.foo/rdm/issues/1", :text => "Bug #1: Can't print recipes"
assert_select "a[href=?]", "http://mydomain.foo/rdm/issues/1", :text => "Bug #1: Can&#39;t print recipes"
# link to a referenced ticket
assert_select "a[href=?][title=?]", "http://mydomain.foo/rdm/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
# link to a changeset