add form_with test

This commit is contained in:
Kanezoh 2021-06-27 20:17:23 +09:00
parent 301a58568e
commit 3fc6227712

View File

@ -29,6 +29,13 @@ describe "Mechanize Page test" do
agent = Mechanize.new
page = agent.get("http://example.com/form")
page.forms.size.should eq 1
page.forms.first.action.should eq "post_path"
page.forms.first.name.should eq "sample_form"
end
it "can detect form by using form_with method" do
agent = Mechanize.new
page = agent.get("http://example.com/form")
form = page.form_with({"name" => "sample_form" })
form.name.should eq "sample_form"
end
end