Hi all This is my first post here. I ave been using Rails for a couple of months, and am starting to put together a test suite. But I''m having a problem with assert_select in my functional tests. According to the documentation, it should be fine with two arguments - a CSS selector and a string to test it against. But no matter what I do I keep getting the exception: wrong number of arguments (6 for 2) It''s defnitely the assert-select line that''s throwing the error - the other tests work if I put that one in a begin-rescue block. I can''t even get an example from the assert_select cheat sheet to run. I''m using Rails 1.2.3, running on ruby 1.8.2 (yeah, I know that''s old, but we''re using Debian...) Any help would be appreciated. -- Chris Ovenden http://thepeer.blogspot.com "Imagine all the people / Sharing all the world" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Ovenden wrote:> wrong number of arguments (6 for 2)What does your assert_select line and stack trace look like? Are you sure your not passing 6 arguments to assert_select? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 3/19/07, Alex Wayne <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Chris Ovenden wrote: > > > wrong number of arguments (6 for 2) > > What does your assert_select line and stack trace look like? Are you > sure your not passing 6 arguments to assert_select? >It doesn''t do anything real, yet, just: assert_select "title", "Used" Stack trace is: test_index(MainControllerTest): ArgumentError: wrong number of arguments (6 for 2) C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/../vendor/html-scanner/html/node.rb:199:in `initialize'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/../vendor/html-scanner/html/node.rb:199:in `new'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/../vendor/html-scanner/html/node.rb:199:in `parse'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/../vendor/html-scanner/html/document.rb:20:in `initialize'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/test_process.rb:439:in `new'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/test_process.rb:439:in `html_document'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/selector_assertions.rb:555:in `response_from_page_or_rjs'' C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/selector_assertions.rb:197:in `assert_select'' Z:/AffiliateSites/Hitachi/test/functional/main_controller_test.rb:36:in `test_index'' -- Chris Ovenden http://thepeer.blogspot.com "Imagine all the people / Sharing all the world" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Would you mind posting your whole text_index method? Based on the one line you posted, there''s no reason why you should be getting that error message. On Mar 19, 11:10 am, "Chris Ovenden" <chris.oven...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 3/19/07, Alex Wayne <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > Chris Ovenden wrote: > > > > wrong number of arguments (6 for 2) > > > What does your assert_select line and stack trace look like? Are you > > sure your not passing 6 arguments to assert_select? > > It doesn''t do anything real, yet, just: > > assert_select "title", "Used" > > Stack trace is: > > test_index(MainControllerTest): > ArgumentError: wrong number of arguments (6 for 2) > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/../vendor/html-scanner/html/node.rb:199:in > `initialize'' > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/../vendor/html-scanner/html/node.rb:199:in > `new'' > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/../vendor/html-scanner/html/node.rb:199:in > `parse'' > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/../vendor/html-scanner/html/document.rb:20:in > `initialize'' > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/test_process.rb:439:in > `new'' > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/test_process.rb:439:in > `html_document'' > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/selector_assertions.rb:555:in > `response_from_page_or_rjs'' > C:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/assertions/selector_assertions.rb:197:in > `assert_select'' > Z:/AffiliateSites/Hitachi/test/functional/main_controller_test.rb:36:in > `test_index'' > > -- > Chris Ovenden > > http://thepeer.blogspot.com > "Imagine all the people / Sharing all the world"--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---