require 'spec_helper' describe LinkOracle do let(:link_data) { LinkOracle.extract_from(url) } let(:url) { 'http://someurl.com' } let(:response) { { status: 200, body: body, headers: {} } } let(:body) { <<-HTML
paragraph 1
paragraph 2
paragraph 3
HTML } before do stub_request(:any, url).to_return(response) end describe '.extract_from' do it "returns a link data object" do link_data.should be_a(LinkOracle::LinkData) end it "defaults to the og title" do link_data.title.should == "This is a title" end it 'defaults to the og image' do link_data.image_url.should == 'http://imageurl.com' end it "defaults to the og description" do link_data.description.should == 'A description for your face' end end end