add form_with test

master
Kanezoh 2021-06-27 20:17:23 +09:00
parent 301a58568e
commit 3fc6227712
1 changed files with 8 additions and 1 deletions

View File

@ -29,6 +29,13 @@ describe "Mechanize Page test" do
agent = Mechanize.new agent = Mechanize.new
page = agent.get("http://example.com/form") page = agent.get("http://example.com/form")
page.forms.size.should eq 1 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
end end