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

Implement ActionController::Parameters#inspect #23732

Merged
merged 1 commit into from
Feb 17, 2016

Conversation

bquorning
Copy link
Contributor

Now that AC::Parameters is no longer a Hash, it shouldn't look like a Hash.

Here's an example from my RSpec output without this PR:

#<Foo:0x007f10be4aa4b8> received :bar with unexpected arguments
  expected: ({"x"=>"y"})
       got: ({"x"=>"y"})
Diff:

Please stub a default value first if message might be received with other args as well.

After this PR, the diff is much more useful:

#<Foo:0x007f5dc8799848> received :bar with unexpected arguments
  expected: ({"x"=>"y"})
       got: (<ActionController::Parameters {"x"=>"y"}>)
Diff:
@@ -1,2 +1,2 @@
-[{"x"=>"y"}]
+[<ActionController::Parameters {"x"=>"y"}>]

Please stub a default value first if message might be received with other args as well.

@rails-bot
Copy link

r? @pixeltrix

(@rails-bot has picked a reviewer for you, use r? to override)

Now that AC::Parameters is no longer a Hash, it shouldn't look like a hash.
@bquorning bquorning force-pushed the actioncontroller-parameters-inspect branch from 2047211 to a623442 Compare February 17, 2016 13:01
@senny
Copy link
Member

senny commented Feb 17, 2016

@bquorning thank you 💛

senny added a commit that referenced this pull request Feb 17, 2016
…inspect

Implement ActionController::Parameters#inspect
@senny senny merged commit 310e441 into rails:master Feb 17, 2016
@bquorning bquorning deleted the actioncontroller-parameters-inspect branch February 17, 2016 13:49
bquorning added a commit to bquorning/rails that referenced this pull request Jun 22, 2016
The changes in this commit are twofold:

 1. The examples showing `#require` accepting two arguments were wrong - you
    have to wrap the arguments (two, or more) in an array.
 2. `ActionController::Parameters` has an `#inspect` method now (since
    rails#23732), and the documentation should
    reflect that.
rafaelfranca pushed a commit that referenced this pull request Jan 18, 2017
The changes in this commit are twofold:

 1. The examples showing `#require` accepting two arguments were wrong - you
    have to wrap the arguments (two, or more) in an array.
 2. `ActionController::Parameters` has an `#inspect` method now (since
    #23732), and the documentation should
    reflect that.

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

Successfully merging this pull request may close these issues.

None yet

5 participants