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