Skip to content

Commit af5904b

Browse files
Fix CI only testing with the paperclip adapter
Since #4666, all jobs have been running with the paperclip adapter. The reason is that when the `paperclip` parameter was `false` on CircleCI, that translated into the `DISABLE_ACTIVE_STORAGE` env var being the string `"false"`. As we were checking for the mere presence of `DISABLE_ACTIVE_STORAGE`, it always evaluated to `true`. Fixes #4901
1 parent 1050ca0 commit af5904b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/lib/spree/testing_support/dummy_app.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Application < ::Rails::Application
9090
config.active_record.dump_schema_after_migration = false
9191

9292
# Configure active storage to use storage within tmp folder
93-
unless ENV['DISABLE_ACTIVE_STORAGE']
93+
unless (ENV['DISABLE_ACTIVE_STORAGE'] == 'true')
9494
initializer 'solidus.active_storage' do
9595
config.active_storage.service_configurations = {
9696
test: {
@@ -140,7 +140,7 @@ class Application < ::Rails::Application
140140
Spree.config do |config|
141141
config.use_legacy_events = (ENV['USE_LEGACY_EVENTS'] == 'true')
142142

143-
if ENV['DISABLE_ACTIVE_STORAGE']
143+
if (ENV['DISABLE_ACTIVE_STORAGE'] == 'true')
144144
config.image_attachment_module = 'Spree::Image::PaperclipAttachment'
145145
config.taxon_attachment_module = 'Spree::Taxon::PaperclipAttachment'
146146
end

core/spec/models/spree/concerns/active_storage_adapter/attachment_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'rails_helper'
44

5-
unless ENV['DISABLE_ACTIVE_STORAGE']
5+
unless (ENV['DISABLE_ACTIVE_STORAGE'] == 'true')
66
RSpec.describe Spree::ActiveStorageAdapter::Attachment do
77
describe '#variant' do
88
it "converts to resize_to_limit when definition doesn't contain any special symbol" do

core/spec/rails_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
config.use_transactional_fixtures = true
3838

3939
config.before :suite do
40-
FileUtils.rm_rf(Rails.configuration.active_storage.service_configurations[:test][:root]) unless ENV['DISABLE_ACTIVE_STORAGE']
40+
FileUtils.rm_rf(Rails.configuration.active_storage.service_configurations[:test][:root]) unless (ENV['DISABLE_ACTIVE_STORAGE'] == 'true')
4141
DatabaseCleaner.clean_with :truncation
4242
end
4343

0 commit comments

Comments
 (0)