Skip to content

Commit

Permalink
Adapt Paperclip config for tests changes in dummy app initializer
Browse files Browse the repository at this point in the history
When eager loading in CI, we need to make sure that changes to
Paperclip default config are applied before the file models are
loaded.

REDMINE-20487
  • Loading branch information
tf committed Nov 14, 2023
1 parent 4ecab98 commit ff141aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion spec/support/pageflow/dummy/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def generate
end

require(File.join(ENV['RAILS_ROOT'], 'config', 'environment'))
require('pageflow/dummy/config/pageflow')
end

def directory
Expand Down
3 changes: 0 additions & 3 deletions spec/support/pageflow/dummy/config/pageflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@
}
end
end

# Reconstruct current config to ensure config block above is used
Pageflow.configure!
6 changes: 6 additions & 0 deletions spec/support/pageflow/dummy/rails_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ def source_paths
ActiveAdmin.application.load_paths.unshift(Dir[Rails.root.join('app/admin')].first)\n
END

# Adapt default configuration

inject_into_file('config/initializers/pageflow.rb',
"require 'pageflow/dummy/config/pageflow'\n",
after: "Pageflow.finalize!\n")

# Add required files for test theme

copy_file('test_theme.scss',
Expand Down

0 comments on commit ff141aa

Please sign in to comment.