-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Precompile assets before tests in test.rb so we get it early enough, …
…and working for all tests
- Loading branch information
1 parent
3c3da43
commit ed0e3a5
Showing
3 changed files
with
19 additions
and
4 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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
task "precompile_assets_once" => :environment do | ||
next if ENV["TEST_ASSET_PRECOMPILE_DONE"] | ||
|
||
p "Compiling assets..." | ||
ENV["TEST_ASSET_PRECOMPILE_DONE"] = "true" | ||
compilation = Rake::Task["assets:precompile"].invoke | ||
|
||
abort "Pre-compilation failed. Cannot run tests." unless compilation | ||
|
||
p "Assets compiled" | ||
end |