require_relative '../../spec_helper'
require 'cgi'
describe "CGI.unescapeElement when passed String, elements, ..." do
it "unescapes only the tags of the passed elements in the passed String" do
res = CGI.unescapeElement("<BR><A HREF="url"></A>", "A", "IMG")
res.should == '<BR>'
res = CGI.unescapeElement('<BR><A HREF="url"></A>', ["A", "IMG"])
res.should == '<BR>'
end
it "is case-insensitive" do
res = CGI.unescapeElement("<BR><A HREF="url"></A>", "a", "img")
res.should == '<BR>'
res = CGI.unescapeElement("<br><a href="url"></a>", "A", "IMG")
res.should == '<br>'
end
end