From 949f5eb86018fedd2c575f84122086b5eae45b32 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 6 Nov 2023 09:28:20 -0500 Subject: [PATCH] Fix `RSpec/MetadataStyle` cop in spec/ (#27729) --- spec/helpers/application_helper_spec.rb | 2 +- spec/lib/feed_manager_spec.rb | 2 +- spec/models/media_attachment_spec.rb | 2 +- spec/requests/api/v1/media_spec.rb | 6 +++--- spec/requests/api/v2/media_spec.rb | 2 +- spec/support/examples/models/concerns/account_avatar.rb | 4 ++-- spec/support/examples/models/concerns/account_header.rb | 2 +- spec/views/statuses/show.html.haml_spec.rb | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index b87d06359e..3f3638e462 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -89,7 +89,7 @@ describe ApplicationHelper do end end - describe 'show_landing_strip?', without_verify_partial_doubles: true do + describe 'show_landing_strip?', :without_verify_partial_doubles do describe 'when signed in' do before do allow(helper).to receive(:user_signed_in?).and_return(true) diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb index f4dd42f845..618b6167bd 100644 --- a/spec/lib/feed_manager_spec.rb +++ b/spec/lib/feed_manager_spec.rb @@ -10,7 +10,7 @@ RSpec.describe FeedManager do end end - it 'tracks at least as many statuses as reblogs', skip_stub: true do + it 'tracks at least as many statuses as reblogs', :skip_stub do expect(FeedManager::REBLOG_FALLOFF).to be <= FeedManager::MAX_ITEMS end diff --git a/spec/models/media_attachment_spec.rb b/spec/models/media_attachment_spec.rb index 6a82c8135a..89916f9f50 100644 --- a/spec/models/media_attachment_spec.rb +++ b/spec/models/media_attachment_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe MediaAttachment, paperclip_processing: true do +RSpec.describe MediaAttachment, :paperclip_processing do describe 'local?' do subject { media_attachment.local? } diff --git a/spec/requests/api/v1/media_spec.rb b/spec/requests/api/v1/media_spec.rb index 7253a9f1e8..2c29328087 100644 --- a/spec/requests/api/v1/media_spec.rb +++ b/spec/requests/api/v1/media_spec.rb @@ -127,19 +127,19 @@ RSpec.describe 'Media' do end end - context 'with image/jpeg', paperclip_processing: true do + context 'with image/jpeg', :paperclip_processing do let(:params) { { file: fixture_file_upload('attachment.jpg', 'image/jpeg'), description: 'jpeg image' } } it_behaves_like 'a successful media upload', 'image' end - context 'with image/gif', paperclip_processing: true do + context 'with image/gif', :paperclip_processing do let(:params) { { file: fixture_file_upload('attachment.gif', 'image/gif') } } it_behaves_like 'a successful media upload', 'image' end - context 'with video/webm', paperclip_processing: true do + context 'with video/webm', :paperclip_processing do let(:params) { { file: fixture_file_upload('attachment.webm', 'video/webm') } } it_behaves_like 'a successful media upload', 'gifv' diff --git a/spec/requests/api/v2/media_spec.rb b/spec/requests/api/v2/media_spec.rb index 89384d0ca3..fc6946be53 100644 --- a/spec/requests/api/v2/media_spec.rb +++ b/spec/requests/api/v2/media_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe 'Media API', paperclip_processing: true do +RSpec.describe 'Media API', :paperclip_processing do let(:user) { Fabricate(:user) } let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } let(:scopes) { 'write' } diff --git a/spec/support/examples/models/concerns/account_avatar.rb b/spec/support/examples/models/concerns/account_avatar.rb index 16ebda5641..2c9b5514aa 100644 --- a/spec/support/examples/models/concerns/account_avatar.rb +++ b/spec/support/examples/models/concerns/account_avatar.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true shared_examples 'AccountAvatar' do |fabricator| - describe 'static avatars', paperclip_processing: true do + describe 'static avatars', :paperclip_processing do describe 'when GIF' do it 'creates a png static style' do account = Fabricate(fabricator, avatar: attachment_fixture('avatar.gif')) @@ -17,7 +17,7 @@ shared_examples 'AccountAvatar' do |fabricator| end end - describe 'base64-encoded files', paperclip_processing: true do + describe 'base64-encoded files', :paperclip_processing do let(:base64_attachment) { "data:image/jpeg;base64,#{Base64.encode64(attachment_fixture('attachment.jpg').read)}" } let(:account) { Fabricate(fabricator, avatar: base64_attachment) } diff --git a/spec/support/examples/models/concerns/account_header.rb b/spec/support/examples/models/concerns/account_header.rb index d65f54f00f..ce09eb006b 100644 --- a/spec/support/examples/models/concerns/account_header.rb +++ b/spec/support/examples/models/concerns/account_header.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true shared_examples 'AccountHeader' do |fabricator| - describe 'base64-encoded files', paperclip_processing: true do + describe 'base64-encoded files', :paperclip_processing do let(:base64_attachment) { "data:image/jpeg;base64,#{Base64.encode64(attachment_fixture('attachment.jpg').read)}" } let(:account) { Fabricate(fabricator, header: base64_attachment) } diff --git a/spec/views/statuses/show.html.haml_spec.rb b/spec/views/statuses/show.html.haml_spec.rb index a9d3edf7a1..233965883a 100644 --- a/spec/views/statuses/show.html.haml_spec.rb +++ b/spec/views/statuses/show.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe 'statuses/show.html.haml', without_verify_partial_doubles: true do +describe 'statuses/show.html.haml', :without_verify_partial_doubles do before do allow(view).to receive_messages(api_oembed_url: '', show_landing_strip?: true, site_title: 'example site', site_hostname: 'example.com', full_asset_url: '//asset.host/image.svg', current_account: nil, single_user_mode?: false) allow(view).to receive(:local_time)