My app works in dev and in prod fine, but when I run a simple rails 5 system test I get:
ActionController::RoutingError: No route matches [GET] "/packs-test/application-ba6af2abeb41bbe4ad46.js"
I updated to the latest rails version and the latest webpacker. I've reinstalled webpacker with:
bundle exec rails webpacker:install
bundle exec rails webpacker:install:react
But I still get the error.
My webpacker.yml is out of the box so nothing special. I do see the application.js in the public/packs-test folder.
I'm using minitest for testing and really just visiting the sign in page causes the error.
visit sign_in_path
Try running RAILS_ENV=test ./bin/rails webpacker:compile
before running your tests.
Ugh, this was caused by a setting in test.rb.
config.public_file_server.enabled = true
I had it changed to false (it should be true like shown above) because of a recommendation by simplecov to overcome some coverage misreporting due to spring.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With