mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
test "Escapes special HTML/XML characters" do ...
This commit is contained in:
@@ -381,6 +381,18 @@ class OutputSafetyTest < ActiveSupport::TestCase
|
||||
assert !@other_combination.html_safe?
|
||||
end
|
||||
|
||||
test "Escapes special HTML/XML characters" do
|
||||
@other_string = "other".html_safe
|
||||
@combination = @other_string + "<foo>&\"'"
|
||||
@other_combination = @string + "<foo>&\"'"
|
||||
|
||||
assert_equal "other<foo>&"'", @combination
|
||||
assert_equal "hello<foo>&\"'", @other_combination
|
||||
|
||||
assert @combination.html_safe?
|
||||
assert !@other_combination.html_safe?
|
||||
end
|
||||
|
||||
test "Concatting safe onto unsafe yields unsafe" do
|
||||
@other_string = "other"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user