Adapt tests for escaping of ' introduced in 8e417fd
This commit is contained in:
parent
cdad6f752a
commit
c80591fe57
@ -29,7 +29,7 @@ class ActivitiesControllerTest < ActionController::TestCase
|
|||||||
:child => { :tag => "dt",
|
:child => { :tag => "dt",
|
||||||
:attributes => { :class => /issue/ },
|
:attributes => { :class => /issue/ },
|
||||||
:child => { :tag => "a",
|
: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",
|
:child => { :tag => "dt",
|
||||||
:attributes => { :class => /issue/ },
|
:attributes => { :class => /issue/ },
|
||||||
:child => { :tag => "a",
|
: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",
|
:child => { :tag => "dt",
|
||||||
:attributes => { :class => /issue/ },
|
:attributes => { :class => /issue/ },
|
||||||
:child => { :tag => "a",
|
: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",
|
:child => { :tag => "dt",
|
||||||
:attributes => { :class => /issue/ },
|
:attributes => { :class => /issue/ },
|
||||||
:child => { :tag => "a",
|
:child => { :tag => "a",
|
||||||
:content => /#{Issue.find(1).subject}/,
|
:content => /#{ERB::Util.h Issue.find(1).subject}/,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
assert_template 'index.rhtml'
|
assert_template 'index.rhtml'
|
||||||
assert_not_nil assigns(:issues)
|
assert_not_nil assigns(:issues)
|
||||||
assert_nil assigns(:project)
|
assert_nil assigns(:project)
|
||||||
assert_tag :tag => 'a', :content => /Can't print recipes/
|
assert_tag :tag => 'a', :content => /Can't print recipes/
|
||||||
assert_tag :tag => 'a', :content => /Subproject issue/
|
assert_tag :tag => 'a', :content => /Subproject issue/
|
||||||
# private projects hidden
|
# private projects hidden
|
||||||
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
|
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
|
||||||
@ -72,7 +72,7 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
assert_template 'index.rhtml'
|
assert_template 'index.rhtml'
|
||||||
assert_not_nil assigns(:issues)
|
assert_not_nil assigns(:issues)
|
||||||
assert_nil assigns(:project)
|
assert_nil assigns(:project)
|
||||||
assert_no_tag :tag => 'a', :content => /Can't print recipes/
|
assert_no_tag :tag => 'a', :content => /Can't print recipes/
|
||||||
assert_tag :tag => 'a', :content => /Subproject issue/
|
assert_tag :tag => 'a', :content => /Subproject issue/
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
assert_template 'index.rhtml'
|
assert_template 'index.rhtml'
|
||||||
assert_not_nil assigns(:issues)
|
assert_not_nil assigns(:issues)
|
||||||
assert_nil assigns(:project)
|
assert_nil assigns(:project)
|
||||||
assert_no_tag :tag => 'a', :content => /Can't print recipes/
|
assert_no_tag :tag => 'a', :content => /Can't print recipes/
|
||||||
assert_tag :tag => 'a', :content => /Subproject issue/
|
assert_tag :tag => 'a', :content => /Subproject issue/
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'index.rhtml'
|
assert_template 'index.rhtml'
|
||||||
assert_not_nil assigns(:issues)
|
assert_not_nil assigns(:issues)
|
||||||
assert_tag :tag => 'a', :content => /Can't print recipes/
|
assert_tag :tag => 'a', :content => /Can't print recipes/
|
||||||
assert_no_tag :tag => 'a', :content => /Subproject issue/
|
assert_no_tag :tag => 'a', :content => /Subproject issue/
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'index.rhtml'
|
assert_template 'index.rhtml'
|
||||||
assert_not_nil assigns(:issues)
|
assert_not_nil assigns(:issues)
|
||||||
assert_tag :tag => 'a', :content => /Can't print recipes/
|
assert_tag :tag => 'a', :content => /Can't print recipes/
|
||||||
assert_tag :tag => 'a', :content => /Subproject issue/
|
assert_tag :tag => 'a', :content => /Subproject issue/
|
||||||
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
|
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
|
||||||
end
|
end
|
||||||
@ -115,7 +115,7 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'index.rhtml'
|
assert_template 'index.rhtml'
|
||||||
assert_not_nil assigns(:issues)
|
assert_not_nil assigns(:issues)
|
||||||
assert_tag :tag => 'a', :content => /Can't print recipes/
|
assert_tag :tag => 'a', :content => /Can't print recipes/
|
||||||
assert_tag :tag => 'a', :content => /Subproject issue/
|
assert_tag :tag => 'a', :content => /Subproject issue/
|
||||||
assert_tag :tag => 'a', :content => /Issue of a private subproject/
|
assert_tag :tag => 'a', :content => /Issue of a private subproject/
|
||||||
end
|
end
|
||||||
@ -1048,7 +1048,7 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'edit'
|
assert_template 'edit'
|
||||||
|
|
||||||
assert_error_tag :descendant => {:content => /Activity can't be blank/}
|
assert_error_tag :descendant => {:content => /Activity can't be blank/}
|
||||||
assert_tag :textarea, :attributes => { :name => 'notes' }, :content => notes
|
assert_tag :textarea, :attributes => { :name => 'notes' }, :content => notes
|
||||||
assert_tag :input, :attributes => { :name => 'time_entry[hours]', :value => "2z" }
|
assert_tag :input, :attributes => { :name => 'time_entry[hours]', :value => "2z" }
|
||||||
end
|
end
|
||||||
@ -1066,8 +1066,8 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'edit'
|
assert_template 'edit'
|
||||||
|
|
||||||
assert_error_tag :descendant => {:content => /Activity can't be blank/}
|
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 => /Hours can't be blank/}
|
||||||
assert_tag :textarea, :attributes => { :name => 'notes' }, :content => notes
|
assert_tag :textarea, :attributes => { :name => 'notes' }, :content => notes
|
||||||
assert_tag :input, :attributes => { :name => 'time_entry[comments]', :value => "this is my comment" }
|
assert_tag :input, :attributes => { :name => 'time_entry[comments]', :value => "this is my comment" }
|
||||||
end
|
end
|
||||||
|
@ -56,6 +56,6 @@ class ApplicationTest < ActionController::IntegrationTest
|
|||||||
|
|
||||||
assert_tag :tag => 'p',
|
assert_tag :tag => 'p',
|
||||||
:attributes => {:id => 'errorExplanation'},
|
: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't exist or has been removed."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -473,7 +473,7 @@ RAW
|
|||||||
|
|
||||||
expected = <<-EXPECTED
|
expected = <<-EXPECTED
|
||||||
<p><a href="/projects/ecookbook/wiki/CookBook_documentation" class="wiki-page">CookBook documentation</a></p>
|
<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't print recipes (New)">#1</a></p>
|
||||||
<pre>
|
<pre>
|
||||||
[[CookBook documentation]]
|
[[CookBook documentation]]
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ class ChiliProject::LiquidTest < ActionView::TestCase
|
|||||||
text = "{% include '<script>alert(\"foo\"):</script>' %}"
|
text = "{% include '<script>alert(\"foo\"):</script>' %}"
|
||||||
formatted = textilizable(text)
|
formatted = textilizable(text)
|
||||||
|
|
||||||
assert formatted.include?("No such page '<script>alert("foo"):</script>'")
|
assert_match /No such page '<script>alert\("foo"\):<\/script>'/, formatted
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -497,7 +497,7 @@ class MailHandlerTest < ActiveSupport::TestCase
|
|||||||
assert mail.to.include?('jsmith@somenet.foo')
|
assert mail.to.include?('jsmith@somenet.foo')
|
||||||
assert mail.subject.include?('Failed email submission: New ticket on a given project')
|
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?('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't be blank')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ class MailerTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
assert_select_email do
|
assert_select_email do
|
||||||
# link to the main ticket
|
# 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't print recipes"
|
||||||
# link to a referenced ticket
|
# link to a referenced ticket
|
||||||
assert_select "a[href=?][title=?]", "https://mydomain.foo/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
|
assert_select "a[href=?][title=?]", "https://mydomain.foo/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
|
||||||
# link to a changeset
|
# link to a changeset
|
||||||
@ -61,7 +61,7 @@ class MailerTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
assert_select_email do
|
assert_select_email do
|
||||||
# link to the main ticket
|
# 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't print recipes"
|
||||||
# link to a referenced ticket
|
# link to a referenced ticket
|
||||||
assert_select "a[href=?][title=?]", "http://mydomain.foo/rdm/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
|
assert_select "a[href=?][title=?]", "http://mydomain.foo/rdm/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
|
||||||
# link to a changeset
|
# link to a changeset
|
||||||
@ -86,7 +86,7 @@ class MailerTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
assert_select_email do
|
assert_select_email do
|
||||||
# link to the main ticket
|
# 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't print recipes"
|
||||||
# link to a referenced ticket
|
# link to a referenced ticket
|
||||||
assert_select "a[href=?][title=?]", "http://mydomain.foo/rdm/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
|
assert_select "a[href=?][title=?]", "http://mydomain.foo/rdm/issues/2", "Add ingredients categories (Assigned)", :text => "#2"
|
||||||
# link to a changeset
|
# link to a changeset
|
||||||
|
Loading…
x
Reference in New Issue
Block a user