Sha256: 112a45000ca64fe3f6efd507de4326b25386362feb71d39fecd89c6c167fe14a

Contents?: true

Size: 593 Bytes

Versions: 1

Compression:

Stored size: 593 Bytes

Contents

require File.join(File.dirname(__FILE__), "../test_helper")
begin
  require "test/unit"
rescue NameError, LoadError
  require "minitest"
end

if defined?(Minitest::Test)
  LoofahTestBaseClass = Minitest::Test
else
  LoofahTestBaseClass = Test::Unit::TestCase
end

class PostsTest < LoofahTestBaseClass
  def test_loofah_scrubbing
    post = Post.new :title => "<script>yo dawg</script>", :body => "<script>omgwtfbbq</script>"
    post.valid?
    assert_equal "yo dawg", post.title
    assert_equal "omgwtfbbq", post.body
  end

  def test_xss_foliation
    assert Post.xss_foliated?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loofah-activerecord-2.0.0 rails_test/common/xss_foliate/test/unit/posts_test.rb