diff --git a/spec/page/link_spec.cr b/spec/page/link_spec.cr new file mode 100644 index 0000000..e42db51 --- /dev/null +++ b/spec/page/link_spec.cr @@ -0,0 +1,17 @@ +require "../spec_helper" + +describe "Mechanize Page Link test" do + it "returns href" do + agent = Mechanize.new + page = agent.get("http://example.com/link") + link = page.links.first + link.href.should eq "http://example.com/" + end + + it "returns text" do + agent = Mechanize.new + page = agent.get("http://example.com/link") + link = page.links.first + link.text.should eq "link text" + end +end diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr index 6000e77..a6d8251 100644 --- a/spec/spec_helper.cr +++ b/spec/spec_helper.cr @@ -29,7 +29,7 @@ WebMock.stub(:get, "example.com/link").to_return(body: <<-BODY