pageflow/support/config/paperclip.rb in pageflow-support-15.3.0 vs pageflow/support/config/paperclip.rb in pageflow-support-15.4.0
- old
+ new
@@ -1,14 +1,22 @@
RSpec.configure do |config|
- config.before(:each) do
+ config.before(:all) do
Dir.glob(Rails.root.join('public', 'system', 's3', '*')).each do |f|
FileUtils.rm_r(f)
end
end
- config.before(:each, stub_paperclip: true) do
- allow_any_instance_of(Paperclip::Attachment).to receive(:post_process)
- allow(Paperclip).to receive(:run).and_return('100x100')
+ config.after(:each, unstub_paperclip: true) do
+ Dir.glob(Rails.root.join('public', 'system', 's3', '*')).each do |f|
+ FileUtils.rm_r(f)
+ end
+ end
+
+ config.before(:each) do |example|
+ unless example.metadata[:unstub_paperclip] || example.metadata[:js]
+ allow_any_instance_of(Paperclip::Attachment).to receive(:post_process)
+ allow(Paperclip).to receive(:run).and_return('100x100')
+ end
end
end
module Paperclip
class Attachment