-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Use keyword args for HTTP methods in controller specs only on Rails 5 #1710
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
Use keyword args for HTTP methods in controller specs only on Rails 5 #1710
Conversation
7bc12a9
to
9fffe39
Compare
These aren't keyword arguments tho, they're keyword argument on Rails 5, but new style hash access on Rails 4, I'm still unsure why it breaks and this doesn't fix the fact that specs don't pick it up... |
Should we replace the let(:valid_attributes) {
- skip("Add a hash of attributes valid for your model")
+ {}
} |
I tried that in #1680, (basically we don't want to remove them from peoples scaffolded specs, but we do want them to run in our specs) but it passes and I'm not sure it's working correctly |
It seems that the scaffold specs are not executed in cukes since they're always removed before each scenario. rspec-rails/features/support/env.rb Lines 37 to 44 in 2175c72
|
9fffe39
to
f9828b4
Compare
This is for running example_app specs in rspec-rails repo: * rspec/rspec-rails#1710 * rspec/rspec-rails#1680
@yujinakayama and @JonRowe I think we should merge this PR, because in Rails 5 HTTP request methods use keyword args to process requests. Whereas any version below Rails 5 uses does not use keyword args. That means our scaffold generator will produce invalid controller specs. For more context please refer to this PR. |
@mrageh as per my earlier comments this shouldn't be merged, Rails 5 swapped option hashes for keyword args, the api is supposed to be compatible without any changes to the user |
@mrageh However if you'd like to work on getting our generated specs being tested as part of the build I'd welcome the help in a seperate PR. |
No, |
@JonRowe I may have missed something, but I'm fairly certain the Rails 5 api change is not backwards compatible. Can you send me some docs/github discussion anything that says otherwise? |
f9828b4
to
6ff6c73
Compare
Since Rails 5 does not support Ruby 1.8, we no longer need to check RUBY_VERSION. This closes #1669.
6ff6c73
to
bb12f85
Compare
|
This closes #1669.