2013-02-12 07:43:18 -05:00
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
require 'oneboxer'
|
|
|
|
require 'oneboxer/flickr_onebox'
|
|
|
|
|
2013-02-25 11:42:20 -05:00
|
|
|
describe Oneboxer::FlickrOnebox do
|
2013-02-13 05:32:18 -05:00
|
|
|
before(:each) do
|
|
|
|
@o = Oneboxer::FlickrOnebox.new("http://www.flickr.com/photos/jaimeiniesta/3303881265")
|
2013-03-23 11:02:59 -04:00
|
|
|
FakeWeb.register_uri(:get, @o.translate_url, response: fixture_file('oneboxer/flickr.response'))
|
2013-02-13 05:32:18 -05:00
|
|
|
end
|
2013-02-25 11:42:20 -05:00
|
|
|
|
2013-02-12 07:43:18 -05:00
|
|
|
it "generates the expected onebox for Flickr" do
|
2013-02-13 05:32:18 -05:00
|
|
|
@o.onebox.should == expected_flickr_result
|
2013-02-12 07:43:18 -05:00
|
|
|
end
|
2013-02-25 11:42:20 -05:00
|
|
|
|
2013-02-12 07:43:18 -05:00
|
|
|
private
|
|
|
|
def expected_flickr_result
|
|
|
|
"<a href='http://www.flickr.com/photos/jaimeiniesta/3303881265' target='_blank'><img src='http://farm4.staticflickr.com/3419/3303881265_c6924748e8_z.jpg' alt=''></a>"
|
|
|
|
end
|
2013-02-25 11:42:20 -05:00
|
|
|
end
|