require 'horseman/hidden_fields'
describe Horseman::HiddenFields do
it "parses a single simple hidden input field" do
html = %{}
cut = described_class.new(html)
cut.tokens.size.should == 1
cut.tokens['test'].should == 'test_data'
end
it "parses a single complex hidden input field" do
html = %{}
cut = described_class.new(html)
cut.tokens.size.should == 1
cut.tokens['test'].should == 'test_data'
end
it "parses multiple hidden input fields" do
html = %{
}
cut = described_class.new(html)
cut.tokens.size.should == 3
cut.tokens['test'].should == 'test_data'
cut.tokens['foo'].should == 'bar'
cut.tokens['dee'].should == 'dum'
end
it "handles single quotes, too" do
html = %{}
cut = described_class.new(html)
cut.tokens.size.should == 1
cut.tokens['test'].should == 'test_data'
end
end