Parameter with the same name as the controller returning the params hash instead of nil

29 views
Skip to first unread message

Andrei G

unread,
Sep 5, 2013, 3:50:45 AM9/5/13
to rubyonra...@googlegroups.com

Hi,

 

I am having an issue with this code[1].

Testing in cucumber if there is no parameter :shot breaks. Somehow the shout parameter it's returning the whole params hash. This thing happens everytime when the parameter has the same name as the controller.

There are any conventions or something?

You can find my cucumber output at [2].

 

[1] https://github.com/otzy007/params-bug

[2] http://showterm.io/ff7e3cdff6d69f4ab3308

 

Andrei

Tamara Temple

unread,
Sep 6, 2013, 11:49:50 AM9/6/13
to rubyonra...@googlegroups.com
So, looking at this error message:

Then the JSON response should have "errors" with the text "No shout message" # cucumber-api-steps-0.10/lib/cucumber/api_st
eps.rb:48
expected ["Done"] to include "No shout message" (RSpec::Expectations::ExpectationNotMetError)
features/shout.feature:25:in `Then the JSON response should have "errors" with the text "No shout message"'

I don't see why it would be looking for ["Done"] — on the other hand, I can't see your step definitions.

Tamara Temple

unread,
Sep 6, 2013, 12:08:19 PM9/6/13
to rubyonra...@googlegroups.com
No, nevermind, I see what is happening. I can't explain why, necessarily. I'm digging deeper.


Tamara Temple

unread,
Sep 6, 2013, 1:22:08 PM9/6/13
to rubyonra...@googlegroups.com
Gah. I can't reproduce your problem: https://gist.github.com/tamouse/6466831


Andrei G

unread,
Sep 6, 2013, 3:46:48 PM9/6/13
to rubyonra...@googlegroups.com
Your Rspec test works. Cucumber not :(

It might be a Cucumber bug?

Tamara Temple

unread,
Sep 6, 2013, 7:57:02 PM9/6/13
to rubyonra...@googlegroups.com
No idea - cuke is running the same stuff underneath. I didn't see any step definitions in your repo. Where are they defined?

Andrei G

unread,
Sep 7, 2013, 3:09:25 AM9/7/13
to rubyonra...@googlegroups.com
I'm using cucumber-api-steps gem, but in the main app I'm not using them and
still I have this problem.
https://gist.github.com/otzy007/6473493
Reply all
Reply to author
Forward
0 new messages