Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capybara and webpacker problem #301

Closed
arrowcircle opened this issue Apr 28, 2017 · 5 comments
Closed

Capybara and webpacker problem #301

arrowcircle opened this issue Apr 28, 2017 · 5 comments

Comments

@arrowcircle
Copy link

Hi! I just tried to use fresh 5.1 rails app with capybara and got error:

Failure/Error: = javascript_pack_tag    'application'

     ActionView::Template::Error:
       Can't find application.js in /****/public/packs/manifest-test.json. Is webpack still compiling?
...
...
# --- Caused by: ---
     # Webpacker::FileLoader::NotFoundError:
     #   Can't find application.js in /***/public/packs/manifest-test.json. Is webpack still compiling?
     #   /***/bundler/gems/webpacker-56bd687798b6/lib/webpacker/manifest.rb:21:in `lookup'

webpack dev server is running.

It looks like rails cant find application.js in test environment, but how to find the solution for this problem?

Development env is working ok.

Any ideas?

@mfazekas
Copy link

RAILS_ENV=test ./bin/rails webpacker:compile

should be executed before running tests

@arrowcircle
Copy link
Author

@mfazekas Thank You! That helped. Do this command interfere with development server?

@gauravtiwari
Copy link
Member

gauravtiwari commented Apr 28, 2017

Nope it doesn't since it's scoped by environment and uses different manifest 👍

@arrowcircle
Copy link
Author

@gauravtiwari Thanks!

@raldred
Copy link

raldred commented Jun 15, 2017

I wonder if it would be nicer if we had something that could be dropped into RSpec's rails_helper.rb
eg. require 'webpacker/rspec'

//edit just come across PR #360
Awesome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants