6

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
4

2 回答 2

7

在运行测试之前尝试运行RAILS_ENV=test ./bin/rails webpacker:compile

于 2017-12-10T02:50:41.127 回答
6

呃,这是由 test.rb 中的设置引起的。

config.public_file_server.enabled = true

由于 simplecov 的建议,我将其更改为 false(如上所示应该为 true),以克服由于春季引起的一些报道误报。

于 2017-12-11T22:18:03.987 回答