From f09d0715a33e13061a05f8fdb66c5f72f4963800 Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Fri, 11 Jun 2021 09:17:59 +0900 Subject: [PATCH] add page#forms test --- spec/page_spec.cr | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spec/page_spec.cr b/spec/page_spec.cr index c060ba5..a40e0a2 100644 --- a/spec/page_spec.cr +++ b/spec/page_spec.cr @@ -10,7 +10,13 @@ WebMock.stub(:get, "html_example.com").to_return(body: page_title - + +
+ + + +
+ BODY ) @@ -39,4 +45,11 @@ describe "Mechanize Page test" do page = agent.get("http://html_example.com") page.title.should eq "page_title" end + + it "return page forms" do + agent = Mechanize.new + page = agent.get("http://html_example.com") + page.forms.size.should eq 1 + page.forms.first.action.should eq "post_path" + end end