From 2f29bb3035fe8cb0b87d355ac6a11f1c9448dff9 Mon Sep 17 00:00:00 2001
From: Benjamin Neff <benjamin@coding4coffee.ch>
Date: Mon, 28 Jun 2021 00:41:33 +0200
Subject: [PATCH] Bump ruby-oembed

---
 Gemfile                                        |  2 +-
 Gemfile.lock                                   |  4 ++--
 .../jasmine_fixtures/aspects_spec.rb           | 18 +++++++++++-------
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/Gemfile b/Gemfile
index 9287ce97d7..8758983c80 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 60f35134c2..b666255200 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 47e5ec8ca0..42d3469002 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
-- 
GitLab