master
Kanezoh 2021-08-19 10:42:11 +09:00
parent d34a20c73c
commit 48549dcaa2
2 changed files with 6 additions and 2 deletions

View File

@ -46,9 +46,9 @@ describe "Mechanize Page test" do
form.name.should eq "sample_form" form.name.should eq "sample_form"
end end
it "return page links" do it "return page links, links means <a> and <area>" do
agent = Mechanize.new agent = Mechanize.new
page = agent.get("http://example.com/link") page = agent.get("http://example.com/link")
page.links.size.should eq 1 page.links.size.should eq 2
end end
end end

View File

@ -30,6 +30,10 @@ WebMock.stub(:get, "example.com/link").to_return(body: <<-BODY
</head> </head>
<body> <body>
<a href="http://example.com/">link text</a> <a href="http://example.com/">link text</a>
<map>
<area shape="rect" coords="184,6,253,27"
href="http://example.com" />
</map>
</body> </body>
</html> </html>
BODY BODY