Sha256: 4b5fba68f8082f6f4332908420af353114b3c186cec553738f9b0565744256e0

Contents?: true

Size: 922 Bytes

Versions: 1

Compression:

Stored size: 922 Bytes

Contents

# encoding: UTF-8
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')

describe EscapeUtils do
  it "should respond to unescape_html" do
    EscapeUtils.should respond_to(:unescape_html)
  end

  context "unescape_html" do
    it "should unescape a basic html tag" do
      EscapeUtils.unescape_html("&lt;some_tag/&gt;").should eql("<some_tag/>")
    end

    it "should unescape double-quotes" do
      EscapeUtils.unescape_html("&lt;some_tag some_attr=&quot;some value&quot;/&gt;").should eql("<some_tag some_attr=\"some value\"/>")
    end

    it "should unescape single-quotes" do
      EscapeUtils.unescape_html("&lt;some_tag some_attr=&#39;some value&#39;/&gt;").should eql("<some_tag some_attr='some value'/>")
    end

    it "should unescape the & character" do
      EscapeUtils.unescape_html("&lt;b&gt;Bourbon &amp; Branch&lt;/b&gt;").should eql("<b>Bourbon & Branch</b>")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
escape_utils-0.1.0 spec/html/unescape_spec.rb