From dc11231a4d728c7f940b5a14c156a4cf3d82133c Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Wed, 9 Jun 2021 21:44:54 +0900 Subject: [PATCH] add simple get test --- spec/mechanize_spec.cr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/mechanize_spec.cr b/spec/mechanize_spec.cr index de1a32c..70ac063 100644 --- a/spec/mechanize_spec.cr +++ b/spec/mechanize_spec.cr @@ -3,11 +3,11 @@ require "webmock" WebMock.stub(:any, "example.com") describe Mechanize do - # TODO: Write tests - - it "works" do - response = HTTP::Client.get("http://example.com") - response.body.should eq "" - response.status_code.should eq 200 + it "simple get" do + agent = Mechanize.new + uri = "http://example.com/" + page = agent.get(uri) + page.code.should eq 200 + page.uri.to_s.should eq uri end end