Created
April 4, 2017 00:06
-
-
Save heliohead/25dc21f279aeb01313ec4d1fffb71f46 to your computer and use it in GitHub Desktop.
Compile assets before run rspec features test
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
# spec/support/feature_helper.rb | |
RSpec.configure do |config| | |
config.before :all do | |
ENV['PRECOMPILE_ASSETS'] ||= begin | |
case self.class.metadata[:type] | |
when :feature, :view | |
STDOUT.write "Precompiling assets..." | |
system "bundle exec rake assets:precompile > /dev/null 2>&1" | |
STDOUT.puts "\n Done." | |
Time.now.to_s | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment