Sha256: 2dfb0262b55082fc4b4130337cc5150f5656c47afcef412d5cb0910eb67c45d9
Contents?: true
Size: 1.07 KB
Versions: 1
Compression:
Stored size: 1.07 KB
Contents
require 'test_helper' require 'action_view' require 'sanitize' require 'sanitize/rails' # Test suite for Sanitize::Rails::Engine class SanitizeRailsStringExtensionTest < Minitest::Test SanitizableString = Class.new(String) { include Sanitize::Rails::String } def setup @string = SanitizableString.new %Q|<script>alert("hello world")</script>| end def test_respond_to_sanitize_as_html_bang assert_respond_to @string, :sanitize_as_html! end def test_sanitize_as_html_bang_does_not_return_safe_buffers sanitizable_string = @string.dup assert_instance_of SanitizableString, sanitizable_string new_string = sanitizable_string.sanitize_as_html! assert_instance_of String, new_string end def test_respond_to_sanitize_as_html assert_respond_to @string, :sanitize_as_html end def test_sanitize_as_html_returns_safe_buffers sanitizable_string = @string.dup assert_instance_of SanitizableString, sanitizable_string new_string = sanitizable_string.sanitize_as_html assert_instance_of ::ActiveSupport::SafeBuffer, new_string end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sanitize-rails-0.8.1 | test/sanitize_rails_string_extension_test.rb |