Andrei G
2013-Sep-05 07:50 UTC
Parameter with the same name as the controller returning the params hash instead of nil
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[1] [2] http://showterm.io/ff7e3cdff6d69f4ab3308[2] Andrei -------- [1] https://github.com/otzy007/params-bug [2] http://showterm.io/ff7e3cdff6d69f4ab3308 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3335912.oaxruYfsnK%40gogu. For more options, visit https://groups.google.com/groups/opt_out.
Tamara Temple
2013-Sep-06 15:49 UTC
Re: Parameter with the same name as the controller returning the params hash instead of nil
On Sep 5, 2013, at 2:50 AM, Andrei G <otzy007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > > AndreiSo, 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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/E4ACFB49-D9A1-4B65-8AF4-C160B970C071%40gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Tamara Temple
2013-Sep-06 16:08 UTC
Re: Parameter with the same name as the controller returning the params hash instead of nil
On Sep 6, 2013, at 10:49 AM, Tamara Temple <tamouse.lists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On Sep 5, 2013, at 2:50 AM, Andrei G <otzy007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> 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 > > > 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.No, nevermind, I see what is happening. I can''t explain why, necessarily. I''m digging deeper. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/19612FC5-B347-4AE3-9B18-E71B1DBCD5D8%40gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Tamara Temple
2013-Sep-06 17:22 UTC
Re: Parameter with the same name as the controller returning the params hash instead of nil
On Sep 6, 2013, at 11:08 AM, Tamara Temple <tamouse.lists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On Sep 6, 2013, at 10:49 AM, Tamara Temple <tamouse.lists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> On Sep 5, 2013, at 2:50 AM, Andrei G <otzy007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> 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 >> >> >> 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. > > No, nevermind, I see what is happening. I can''t explain why, necessarily. I''m digging deeper.Gah. I can''t reproduce your problem: https://gist.github.com/tamouse/6466831 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/D8D9800E-E3A4-4E11-9110-68ABB7996F77%40gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Andrei G
2013-Sep-06 19:46 UTC
Re: Parameter with the same name as the controller returning the params hash instead of nil
On Friday 06 September 2013 12:22:08 Tamara Temple wrote:> On Sep 6, 2013, at 11:08 AM, Tamara Temple <tamouse.lists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On Sep 6, 2013, at 10:49 AM, Tamara Temple <tamouse.lists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> >> On Sep 5, 2013, at 2:50 AM, Andrei G <otzy007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>> 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 > >> > >> 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.> > > No, nevermind, I see what is happening. I can''t explain why, necessarily. > > I''m digging deeper. > Gah. I can''t reproduce your problem: https://gist.github.com/tamouse/6466831Your Rspec test works. Cucumber not :( It might be a Cucumber bug? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8487364.hNSfv4vNy3%40gogu. For more options, visit https://groups.google.com/groups/opt_out.
Tamara Temple
2013-Sep-06 23:57 UTC
Re: Parameter with the same name as the controller returning the params hash instead of nil
On Sep 6, 2013, at 2:46 PM, Andrei G <otzy007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Friday 06 September 2013 12:22:08 Tamara Temple wrote: >> On Sep 6, 2013, at 11:08 AM, Tamara Temple <tamouse.lists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> On Sep 6, 2013, at 10:49 AM, Tamara Temple <tamouse.lists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >>>> On Sep 5, 2013, at 2:50 AM, Andrei G <otzy007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>> 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 >>>> >>>> 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.> >>> No, nevermind, I see what is happening. I can''t explain why, necessarily. >>> I''m digging deeper. >> Gah. I can''t reproduce your problem: https://gist.github.com/tamouse/6466831 > > Your Rspec test works. Cucumber not :( > > It might be a Cucumber bug?No idea - cuke is running the same stuff underneath. I didn''t see any step definitions in your repo. Where are they defined? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/A6D79EFA-392F-426E-9776-D1DB978126F2%40gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Andrei G
2013-Sep-07 07:09 UTC
Re: Parameter with the same name as the controller returning the params hash instead of nil
On Friday 06 September 2013 18:57:02 Tamara Temple wrote:> On Sep 6, 2013, at 2:46 PM, Andrei G <otzy007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On Friday 06 September 2013 12:22:08 Tamara Temple wrote: > >> On Sep 6, 2013, at 11:08 AM, Tamara Temple <tamouse.lists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> >>> On Sep 6, 2013, at 10:49 AM, Tamara Temple <tamouse.lists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > wrote: > >>>> On Sep 5, 2013, at 2:50 AM, Andrei G <otzy007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>>>> 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 > >>>> > >>>> 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.> > >>> > >>> No, nevermind, I see what is happening. I can''t explain why, > >>> necessarily. > >>> I''m digging deeper. > >> > >> Gah. I can''t reproduce your problem: > >> https://gist.github.com/tamouse/6466831> > > Your Rspec test works. Cucumber not :( > > > > It might be a Cucumber bug? > > No idea - cuke is running the same stuff underneath. I didn''t see any step > definitions in your repo. Where are they defined?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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/12309854.YnW1mKQ4Mx%40gogu. For more options, visit https://groups.google.com/groups/opt_out.