Skip to content

Commit

Permalink
Skip paperclip spoof detector unless opted into attachment processing…
Browse files Browse the repository at this point in the history
… specs (mastodon#31454)
  • Loading branch information
mjankowski authored Sep 3, 2024
1 parent 69dbc23 commit 19849eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ def sign_in(resource, _deprecated = nil, scope: nil)

config.before do |example|
unless example.metadata[:attachment_processing]
allow_any_instance_of(Paperclip::Attachment).to receive(:post_process).and_return(true) # rubocop:disable RSpec/AnyInstance
# rubocop:disable RSpec/AnyInstance
allow_any_instance_of(Paperclip::Attachment).to receive(:post_process).and_return(true)
allow_any_instance_of(Paperclip::MediaTypeSpoofDetector).to receive(:spoofed?).and_return(false)
# rubocop:enable RSpec/AnyInstance
end
end

Expand Down

0 comments on commit 19849eb

Please sign in to comment.