add page#forms test
This commit is contained in:
parent
0b130e7da7
commit
f09d0715a3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user