add page#forms test

master
Kanezoh 2021-06-11 09:17:59 +09:00
parent 0b130e7da7
commit f09d0715a3
1 changed files with 14 additions and 1 deletions

View File

@ -10,7 +10,13 @@ WebMock.stub(:get, "html_example.com").to_return(body:
<head>
<title>page_title</title>
</head>
<body></body>
<body>
<form action="post_path">
<input type="text" name="name">
<input type="text" name="email">
<input type="submit" value="">
</form>
</body>
</html>
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