Sha256: b6fe0b1053d89b1a97f64361c5302c85a6e917a2ec19bcd111cb1be7c415ae96
Contents?: true
Size: 677 Bytes
Versions: 6
Compression:
Stored size: 677 Bytes
Contents
require 'test_helper' class RailsXssTest < ActiveSupport::TestCase test "ERB::Util.h should mark its return value as safe and escape it" do escaped = ERB::Util.h("<p>") assert_equal "<p>", escaped assert escaped.html_safe? end test "ERB::Util.h should leave previously safe strings alone " do # TODO this seems easier to compose and reason about, but # this should be verified escaped = ERB::Util.h("<p>".html_safe) assert_equal "<p>", escaped assert escaped.html_safe? end test "ERB::Util.h should not implode when passed a non-string" do assert_nothing_raised do assert_equal "1", ERB::Util.h(1) end end end
Version data entries
6 entries across 6 versions & 2 rubygems