diff --git a/Gemfile b/Gemfile index 9287ce97d7d57982a60d7dd38924e4a1b86752a6..8758983c80116b11b8ef84d058f4bc54812392ce 100644 --- a/Gemfile +++ b/Gemfile @@ -145,7 +145,7 @@ gem "leaflet-rails", "1.7.0" gem "nokogiri", "1.11.7" gem "open_graph_reader", "0.7.1" # also update User-Agent in features/support/webmock.rb and open_graph_cache_spec.rb gem "redcarpet", "3.5.1" -gem "ruby-oembed", "0.12.0" +gem "ruby-oembed", "0.15.0" gem "twitter-text", "1.14.7" # RTL support diff --git a/Gemfile.lock b/Gemfile.lock index 60f35134c2bc23cb561b4548a210c0edac0f03a4..b666255200ddfee29941c666e8a3f4edc32e6066 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -661,7 +661,7 @@ GEM activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 0.90.0, < 2.0) - ruby-oembed (0.12.0) + ruby-oembed (0.15.0) ruby-progressbar (1.11.0) ruby-vips (2.1.2) ffi (~> 1.12) @@ -906,7 +906,7 @@ DEPENDENCIES rspec-rails (= 5.0.1) rubocop (= 0.93.1) rubocop-rails (= 2.9.1) - ruby-oembed (= 0.12.0) + ruby-oembed (= 0.15.0) rubyzip (= 2.3.0) sass-rails (= 5.0.7) secure_headers (= 6.3.2) diff --git a/spec/controllers/jasmine_fixtures/aspects_spec.rb b/spec/controllers/jasmine_fixtures/aspects_spec.rb index 47e5ec8ca08973f675560c44ce6d193293bca005..42d34690024a843572c9a9e4cbddd40ac776e2f0 100644 --- a/spec/controllers/jasmine_fixtures/aspects_spec.rb +++ b/spec/controllers/jasmine_fixtures/aspects_spec.rb @@ -86,19 +86,23 @@ describe StreamsController, :type => :controller do save_fixture(html_for("body"), "aspects_index_with_one_followed_tag") end - it "generates a jasmine fixture with a post containing a video", :fixture => true do + it "generates a jasmine fixture with a post containing a video", fixture: true do stub_request( :get, - "https://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&scheme=https&url=http://www.youtube.com/watch?v=UYrkQL1bX4A" + "https://www.youtube.com/oembed/?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&scheme=https&url=https://www.youtube.com/watch?v=UYrkQL1bX4A" ).with( - :headers => {'Accept'=>'*/*'} + headers: { + "Accept" => "*/*", + "Accept-Encoding" => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3", + "User-Agent" => "Mozilla/5.0 (compatible; ruby-oembed/#{OEmbed::VERSION})" + } ).to_return( - :status => 200, - :body => '{ "title": "LazyTown song - Cooking By The Boo" }', - :headers => {} + status: 200, + body: '{ "title": "LazyTown song - Cooking By The Boo" }', + headers: {} ) - alice.post(:status_message, :text => "http://www.youtube.com/watch?v=UYrkQL1bX4A", :to => @alices_aspect_2.id) + alice.post(:status_message, text: "https://www.youtube.com/watch?v=UYrkQL1bX4A", to: @alices_aspect_2.id) get :aspects save_fixture(html_for("body"), "aspects_index_with_video_post") end