From 943738671c02424b4956de0994c4bd298191fe54 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 18 Sep 2024 04:21:31 -0400 Subject: [PATCH] Remove unneeded `to_s` on `Link` header comparison in statuses controller spec (#31941) --- spec/controllers/statuses_controller_spec.rb | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb index 5042523df82..d9702251f41 100644 --- a/spec/controllers/statuses_controller_spec.rb +++ b/spec/controllers/statuses_controller_spec.rb @@ -63,7 +63,7 @@ RSpec.describe StatusesController do expect(response.headers).to include( 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('public'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.body).to include status.text end @@ -79,7 +79,7 @@ RSpec.describe StatusesController do expect(response.headers).to include( 'Content-Type' => include('application/activity+json'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.parsed_body) .to include(content: include(status.text)) @@ -168,7 +168,7 @@ RSpec.describe StatusesController do expect(response.headers).to include( 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.body).to include status.text end @@ -184,7 +184,7 @@ RSpec.describe StatusesController do 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), 'Content-Type' => include('application/activity+json'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.parsed_body) .to include(content: include(status.text)) @@ -212,7 +212,7 @@ RSpec.describe StatusesController do expect(response.headers).to include( 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.body).to include status.text end @@ -228,7 +228,7 @@ RSpec.describe StatusesController do 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), 'Content-Type' => include('application/activity+json'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.parsed_body) .to include(content: include(status.text)) @@ -278,7 +278,7 @@ RSpec.describe StatusesController do expect(response.headers).to include( 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.body).to include status.text end @@ -294,7 +294,7 @@ RSpec.describe StatusesController do 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), 'Content-Type' => include('application/activity+json'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.parsed_body) .to include(content: include(status.text)) @@ -370,7 +370,7 @@ RSpec.describe StatusesController do expect(response.headers).to include( 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.body).to include status.text end @@ -385,7 +385,7 @@ RSpec.describe StatusesController do .and have_cacheable_headers.with_vary('Accept, Accept-Language, Cookie') expect(response.headers).to include( 'Content-Type' => include('application/activity+json'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.parsed_body) .to include(content: include(status.text)) @@ -412,7 +412,7 @@ RSpec.describe StatusesController do expect(response.headers).to include( 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.body).to include status.text end @@ -428,7 +428,7 @@ RSpec.describe StatusesController do 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), 'Content-Type' => include('application/activity+json'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.parsed_body) @@ -479,7 +479,7 @@ RSpec.describe StatusesController do expect(response.headers).to include( 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.body).to include status.text end @@ -495,7 +495,7 @@ RSpec.describe StatusesController do 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('private'), 'Content-Type' => include('application/activity+json'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) expect(response.parsed_body) .to include(content: include(status.text)) @@ -779,7 +779,7 @@ RSpec.describe StatusesController do expect(response.headers).to include( 'Vary' => 'Accept, Accept-Language, Cookie', 'Cache-Control' => include('public'), - 'Link' => satisfy { |header| header.to_s.include?('activity+json') } + 'Link' => include('activity+json') ) end end