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
codez-tarantula-0.5.5 vendor/xss-shield/test/test_actionview_integration.rb
codez-tarantula-0.5.4 vendor/xss-shield/test/test_actionview_integration.rb
artmotion-xss_shield-0.0.1 test/test_actionview_integration.rb
artmotion-xss_shield-0.0.2 test/test_actionview_integration.rb
relevance-tarantula-0.0.1 vendor/xss-shield/test/test_actionview_integration.rb
relevance-tarantula-0.0.2 vendor/xss-shield/test/test_actionview_integration.rb
relevance-tarantula-0.0.3 vendor/xss-shield/test/test_actionview_integration.rb
relevance-tarantula-0.0.5 vendor/xss-shield/test/test_actionview_integration.rb
relevance-tarantula-0.0.6 vendor/xss-shield/test/test_actionview_integration.rb
relevance-tarantula-0.0.7.1 vendor/xss-shield/test/test_actionview_integration.rb
relevance-tarantula-0.0.7 vendor/xss-shield/test/test_actionview_integration.rb
relevance-tarantula-0.0.8.0 vendor/xss-shield/test/test_actionview_integration.rb
relevance-tarantula-0.0.8.1 vendor/xss-shield/test/test_actionview_integration.rb
romanbsd-tarantula-0.1.8 vendor/xss-shield/test/test_actionview_integration.rb
romanbsd-tarantula-0.2.0 vendor/xss-shield/test/test_actionview_integration.rb
codez-tarantula-0.5.3 vendor/xss-shield/test/test_actionview_integration.rb
codez-tarantula-0.5.1 vendor/xss-shield/test/test_actionview_integration.rb
codez-tarantula-0.5.0 vendor/xss-shield/test/test_actionview_integration.rb
tarantula-0.5.1 vendor/xss-shield/test/test_actionview_integration.rb
tarantula-0.5.0 vendor/xss-shield/test/test_actionview_integration.rb