adds stub_request for outside http call

This commit is contained in:
Jessica Dillon & Jessica Lynn Suttles 2013-07-01 17:43:31 -07:00
parent 27822a835f
commit 73d25abefe

View file

@ -23,6 +23,9 @@ describe Microformats2 do
Microformats2.read_html(html).should include "<div class=\"h-card\">"
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