diff --git a/spec/page_spec.cr b/spec/page_spec.cr
index 59a642d..c060ba5 100644
--- a/spec/page_spec.cr
+++ b/spec/page_spec.cr
@@ -3,6 +3,17 @@ require "webmock"
WebMock.stub(:get, "example.com")
WebMock.stub(:get, "fail_example.com").to_return(status: 500)
WebMock.stub(:get, "body_example.com").to_return(body: "hello")
+WebMock.stub(:get, "html_example.com").to_return(body:
+<<-BODY
+
+
+
+ page_title
+
+
+
+BODY
+)
describe "Mechanize Page test" do
it "return status code of request" do
@@ -20,4 +31,12 @@ describe "Mechanize Page test" do
page = agent.get("http://body_example.com")
page.body.should eq "hello"
end
+
+ it "return page title" do
+ agent = Mechanize.new
+ page = agent.get("http://example.com/")
+ page.title.should eq ""
+ page = agent.get("http://html_example.com")
+ page.title.should eq "page_title"
+ end
end