From 3fc6227712c9d50846e2d557fc3354687d49d34c Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Sun, 27 Jun 2021 20:17:23 +0900 Subject: [PATCH] add form_with test --- spec/page_spec.cr | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/page_spec.cr b/spec/page_spec.cr index bfa32b4..b49f4c9 100644 --- a/spec/page_spec.cr +++ b/spec/page_spec.cr @@ -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