jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 244 forks source link

sprockets-rails 3: Asset was not declared to be precompiled in production. #460

Closed mihai-dinculescu closed 8 years ago

mihai-dinculescu commented 8 years ago

Yet another problem with sprockets-rails 3...

rails _4.2.6_ new tstest --skip-bundle --skip-activerecord --skip-test --skip-turbolinks
cd tstest
echo "gem 'teaspoon-jasmine', group: [:development, :test]" >> Gemfile
bundle install
rails generate teaspoon:install
rails s

Navigate to /teaspoon. The following error pops when clicking default

Asset was not declared to be precompiled in production.
Add `Rails.application.config.assets.precompile += %w( support/phantomjs-shims.self.js )` to `config/initializers/assets.rb` and restart your server

Funny enough, adding that line to config/initializers/assets.rb doesn't fix the problem. Neighter does rake tmp:clear or rake assets:precompile.

Update It looks related to the ActionView::VERSION::STRING.start_with?('4.2.5') line in engine.rb.

Surely that piece of code should cover future versions as well?

I'll create a PR later this evening.

mockdeep commented 8 years ago

We just ran into this, too. It would be good to make sure it's future proof so that security releases aren't blocked by teaspoon.

jejacks0n commented 8 years ago

@mockdeep -- It's near impossible to have it be future proof since it's based on a third party that has changed things fairly consistently throughout the life of teaspoon. =)