Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable paperclip processing in specs #25359

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/models/media_attachment_spec.rb
Expand Up @@ -2,7 +2,7 @@

require 'rails_helper'

RSpec.describe MediaAttachment do
RSpec.describe MediaAttachment, paperclip_processing: true do
describe 'local?' do
subject { media_attachment.local? }

Expand Down
6 changes: 6 additions & 0 deletions spec/rails_helper.rb
Expand Up @@ -94,6 +94,12 @@ def get(path, headers: nil, sign_with: nil, **args)
stub_jsonld_contexts!
end

config.before(:each) do |example|
unless example.metadata[:paperclip_processing]
allow_any_instance_of(Paperclip::Attachment).to receive(:post_process).and_return(true) # rubocop:disable RSpec/AnyInstance
end
end

config.after :each do
Rails.cache.clear
redis.del(redis.keys)
Expand Down
2 changes: 1 addition & 1 deletion spec/support/examples/models/concerns/account_avatar.rb
Expand Up @@ -17,7 +17,7 @@
end
end

describe 'base64-encoded files' do
describe 'base64-encoded files', paperclip_processing: true do
let(:base64_attachment) { "data:image/jpeg;base64,#{Base64.encode64(attachment_fixture('attachment.jpg').read)}" }
let(:account) { Fabricate(fabricator, avatar: base64_attachment) }

Expand Down
2 changes: 1 addition & 1 deletion 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' do
describe 'base64-encoded files', paperclip_processing: true do
let(:base64_attachment) { "data:image/jpeg;base64,#{Base64.encode64(attachment_fixture('attachment.jpg').read)}" }
let(:account) { Fabricate(fabricator, header: base64_attachment) }

Expand Down