Sha256: c3aad5cb8b2ce2d307b7a3bdd752340a69e7ddca6022ca9fc69a0b8462d792b9

Contents?: true

Size: 712 Bytes

Versions: 26

Compression:

Stored size: 712 Bytes

Contents

# Run from your Rails main directory
require 'test/test_helper'

class TestActionViewIntegration < Test::Unit::TestCase
  def assert_renders(expected, input, extension)
    base = ActionView::Base.new
    actual = base.render_template(extension, input, "foo.#{extension}")
    assert_equal expected, actual
  end

  def test_erb
    assert_renders <<OUT, <<IN, :erb
A & B
A & B
OUT
<%= "A & B" %>
<%= "A & B".mark_as_xss_protected %>
IN
  end

  def test_rhtml
    assert_renders <<OUT, <<IN, :rhtml
A &amp; B
A & B
OUT
<%= "A & B" %>
<%= "A & B".mark_as_xss_protected %>
IN
  end
 
  def test_haml
    assert_renders <<OUT, <<IN, :haml
A &amp; B
A & B
OUT
= "A & B"
= "A & B".mark_as_xss_protected
IN
  end
end

Version data entries

26 entries across 26 versions & 5 rubygems

Version Path
tarantula-0.4.3 vendor/xss-shield/test/test_actionview_integration.rb
tarantula-0.4.2 vendor/xss-shield/test/test_actionview_integration.rb
tarantula-0.4.1 vendor/xss-shield/test/test_actionview_integration.rb
tarantula-0.4.0 vendor/xss-shield/test/test_actionview_integration.rb
tarantula-0.0.8.1 vendor/xss-shield/test/test_actionview_integration.rb
tarantula-0.0.5 vendor/xss-shield/test/test_actionview_integration.rb