diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index a46be3693..d42153eae 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -110,9 +110,28 @@ describe AspectsController do end it "generates a jasmine fixture with a post containing a video", :fixture => true do - stub_request(:get, "http://gdata.youtube.com/feeds/api/videos/UYrkQL1bX4A?v=2"). - with(:headers => {'Accept'=>'*/*'}). - to_return(:status => 200, :body => "LazyTown song - Cooking By The Book", :headers => {}) + stub_request( + :get, + "http://gdata.youtube.com/feeds/api/videos/UYrkQL1bX4A?v=2" + ).with( + :headers => {'Accept'=>'*/*'} + ).to_return( + :status => 200, + :body => "LazyTown song - Cooking By The Book", + :headers => {} + ) + + stub_request( + :get, + "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://www.youtube.com/watch?v=UYrkQL1bX4A" + ).with( + :headers => {'Accept'=>'*/*'} + ).to_return( + :status => 200, + :body => "{ title: 'LazyTown song - Cooking By The Book' }", + :headers => {} + ) + alice.post(:status_message, :text => "http://www.youtube.com/watch?v=UYrkQL1bX4A", :to => @alices_aspect_2.id) get :index save_fixture(html_for("body"), "aspects_index_with_video_post")