From 73d25abefe1c9a091ef4b7f5f57e52513512f87c Mon Sep 17 00:00:00 2001 From: Jessica Dillon & Jessica Lynn Suttles Date: Mon, 1 Jul 2013 17:43:31 -0700 Subject: [PATCH] adds stub_request for outside http call --- spec/lib/microformats2_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/lib/microformats2_spec.rb b/spec/lib/microformats2_spec.rb index 613ac75..31cf743 100644 --- a/spec/lib/microformats2_spec.rb +++ b/spec/lib/microformats2_spec.rb @@ -23,6 +23,9 @@ describe Microformats2 do Microformats2.read_html(html).should include "
" end it "can be a url to html" do + stub_request(:get, "http://google.com/"). + with(:headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}). + to_return(:status => 200, :body => "google", :headers => {}) html = "http://google.com" Microformats2.read_html(html).should include "google" end