-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix assets compilation failing in prod
Assets compilation was failing because tailwind css is trying to be compressed by sassc. Read: thoughtbot/administrate#2091 I have updated test and production enviroments and added a test that checks that no errors ocurs on the precompile task and that production config is matching tests in this specific scenario
- Loading branch information
1 parent
8e4fdb5
commit d90016c
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'rails_helper' | ||
require 'rake' | ||
|
||
Rails.application.load_tasks if Rake::Task.tasks.empty? | ||
|
||
RSpec.describe "assets", type: :task do | ||
describe 'rake assets:precompile' do | ||
let(:task) { Rake::Task["assets:precompile"] } | ||
|
||
it 'does not throw an error when disabling css compressor' do | ||
expect { task.invoke }.not_to raise_error | ||
end | ||
|
||
it 'makes sure that compressor is disabled in production' do | ||
file = File.read("config/environments/production.rb") | ||
expect(file).to include("config.assets.css_compressor = nil") | ||
end | ||
end | ||
end |