Mikel Lindsaar
2008-Jun-05 05:33 UTC
[rspec-users] xhr :post giving wrong number of arguments on rails 2.1?
Getting a strange error. In a story I have the following step: When "I submit a search name" do xhr :post, ''/searches'', {:search => {:given_name => "bob", :family_name => "smith"}} end I am getting: ArgumentError: wrong number of arguments (4 for 3) stories/searching_story_spec.rb:45 in "I submit a search name" But I only have 3 arguments in the above list, a symbol, a string and a hash. No exception comes up in the test.log I am on Rspec trunk from a couple of days ago and Rails 2.1. Any ideas? Mikel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080605/3f24b2b1/attachment.html>
Zach Dennis
2008-Jun-05 15:39 UTC
[rspec-users] xhr :post giving wrong number of arguments on rails 2.1?
Use xml_http_request in your stories rather than xhr. I believe the "xhr" method is aliased to the wrong method... I haven''t looked to see if this is a Rails issue or a rspec-rails issue, Zach On Thu, Jun 5, 2008 at 1:33 AM, Mikel Lindsaar <raasdnil at gmail.com> wrote:> Getting a strange error. > In a story I have the following step: > > When "I submit a search name" do > xhr :post, ''/searches'', {:search => {:given_name => "bob", :family_name > => "smith"}} > end > > I am getting: > > ArgumentError: wrong number of arguments (4 for 3) > stories/searching_story_spec.rb:45 in "I submit a search name" > > But I only have 3 arguments in the above list, a symbol, a string and a > hash. > > No exception comes up in the test.log > > I am on Rspec trunk from a couple of days ago and Rails 2.1. > > Any ideas? > > Mikel > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- Zach Dennis http://www.continuousthinking.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080605/f9badd1d/attachment-0001.html>
Mikel Lindsaar
2008-Jun-06 05:02 UTC
[rspec-users] xhr :post giving wrong number of arguments on rails 2.1?
On Fri, Jun 6, 2008 at 1:39 AM, Zach Dennis <zach.dennis at gmail.com> wrote:> Use xml_http_request in your stories rather than xhr. I believe the "xhr" > method is aliased to the wrong method... I haven''t looked to see if this is > a Rails issue or a rspec-rails issue, >Thanks, that worked. Mikel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080606/87722de8/attachment.html>