require 'spec_helper' describe LinkOracle do let(:link_data) { LinkOracle.extract_from('http://someurl.com') } let(:response) { double( code: 200, body: body, headers: {} ) } let(:body) { <<-HTML TITLE!

Berkin

Derbin

Cherbin

paragraph 1

paragraph 2

paragraph 3

HTML } before do RestClient.stub(:get).and_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