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
should permit failing after rails upgrade for rails 5.1.0 #1018
Comments
@Hareramrai Can you provide a backtrace? |
I'm having the same issue.
|
FWIW, updating i.e. in line 253: Doublespeak.with_doubles_activated do
context.__send__(verb, action, params: request_params)
end |
This is throwing a deprecation warning in 5.0.3 as well. |
Monkey patch with #1018 (comment) for those who want it while waiting for a fix to get released. # spec/support/shoulda-matchers.rb
require 'shoulda-matchers'
module ShouldaMatcherFixes
# https://github.com/thoughtbot/shoulda-matchers/blob/master/lib/shoulda/matchers/action_controller/permit_matcher.rb
module PermitMatcher
# Monkey patch for Rails 5
#
# Original: https://github.com/thoughtbot/shoulda-matchers/blob/44c0198830921650af3b4a56f5d72aaae2168480/lib/shoulda/matchers/action_controller/permit_matcher.rb#L246-L257
# Fix taken from: https://github.com/thoughtbot/shoulda-matchers/issues/1018#issuecomment-303796064
#
# @todo Put some type of check here so that the fix does not come out
# and we are stuck with this still kicking around.
def matches?(controller)
@controller = controller
ensure_action_and_verb_present!
parameters_double_registry.register
Shoulda::Matchers::Doublespeak.with_doubles_activated do
# context.__send__(verb, action, request_params)
context.__send__(verb, action, params: request_params)
end
unpermitted_parameter_names.empty?
end
end
end
Shoulda::Matchers::ActionController::PermitMatcher.prepend ShouldaMatcherFixes::PermitMatcher |
@mcmire Assume you would take a pull request against the https://github.com/thoughtbot/shoulda-matchers/tree/rails-5 branch for this fix? I can do so if that is right place to submit this fix to. |
@mdeering Yes, rails-5 is the right branch for Rails 5.x fixes. |
Hey all! This appears to be... different in I was able to get the deprecation warning to go away by adding another
Thanks to everyone for your hard work on this gem, I definitely appreciate it. |
It looks like #989 will address this issue. I'll merge it into the |
Hi there,
I have below code for should permit spec.
Above code was working with rails 5.0.2 and now i am getting the below error.
Regards,
Hare
The text was updated successfully, but these errors were encountered: