Skip to content

Update RSpec testing info in README #217

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

Closed
wants to merge 1 commit into from

Conversation

etrepum
Copy link

@etrepum etrepum commented Feb 4, 2016

ReactOnRails.configure_rspec_to_compile_assets(config) is used in the current rails_helper.rb instead of config.include ReactOnRails::EnsureAssetsCompiled, type: :feature

Review on Reviewable

`ReactOnRails.configure_rspec_to_compile_assets(config)` is used in the current `rails_helper.rb` instead of `config.include ReactOnRails::EnsureAssetsCompiled, type: :feature`
@@ -106,7 +106,7 @@ We're now using Webpack for all Sass and JavaScript assets so we can do CSS Modu
<%= env_javascript_include_tag(hot: ['http://localhost:3500/vendor-bundle.js', 'http://localhost:3500/app-bundle.js']) %>
<%= env_javascript_include_tag(static: 'application_static', hot: 'application_non_webpack', options: { 'data-turbolinks-track' => true }) %>
```
1. **Testing Mode**: When running tests, it is useful to run `foreman start -f Procfile.spec` in order to have webpack automatically recompile the static bundles. Rspec is configured to automatically check whether or not this process is running. If it is not, it will automatically rebuild the webpack bundle to ensure you are not running tests on stale client code. This is achieved via the ` config.include ReactOnRails::EnsureAssetsCompiled, type: :feature` line in the `rails_helper.rb` file. If you are using this project as an example and are not using RSpec, you may want to implement similar logic in your own project.
1. **Testing Mode**: When running tests, it is useful to run `foreman start -f Procfile.spec` in order to have webpack automatically recompile the static bundles. Rspec is configured to automatically check whether or not this process is running. If it is not, it will automatically rebuild the webpack bundle to ensure you are not running tests on stale client code. This is achieved via the `ReactOnRails.configure_rspec_to_compile_assets(config)` line in the `rails_helper.rb` file. If you are using this project as an example and are not using RSpec, you may want to implement similar logic in your own project.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @etrepum.

@robwise is about to make this even better, so not sure if we should merge this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be a bit silly not to, the text is incorrect as-is.

@justin808
Copy link
Member

@robwise should we merge this?

@robwise
Copy link
Contributor

robwise commented Feb 15, 2016

We should reflect the new V3 API:

ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)

https://github.com/shakacode/react_on_rails/blob/master/docs%2Fadditional_reading%2Frspec_configuration.md

@justin808
Copy link
Member

@etrepum Thanks for helping. I'll merge once you update to the latest.

See
https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/spec%2Frails_helper.rb#L43

@etrepum
Copy link
Author

etrepum commented Feb 15, 2016

Since you know what it's supposed to be, maybe you should just make the change? I'll close this PR.

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

Successfully merging this pull request may close these issues.

3 participants