Sha256: 5b8e5be9a31e748b643b5ffa376a73ebe3694365ed6f4fef5e4c352118bdf18e

Contents?: true

Size: 557 Bytes

Versions: 26

Compression:

Stored size: 557 Bytes

Contents

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

class TestHelpers < Test::Unit::TestCase
  def setup
    @base = ActionView::Base.new
  end

  def assert_haml_renders(expected, input)
    actual = Haml::Engine.new(input).to_html(@base)
    assert_equal expected, actual
  end

  def test_link_to
    assert_haml_renders <<OUT, <<IN
<a href="/bar">Foo</a>
<a href="/bar">Foo &amp; Bar</a>
<a href="/bar">Foo & Bar</a>
OUT
= link_to "Foo", "/bar"
= link_to "Foo & Bar", "/bar"
= link_to "Foo & Bar".mark_as_xss_protected, "/bar"
IN
  end
end

Version data entries

26 entries across 26 versions & 5 rubygems

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