Forum: Ruby on Rails Assert_select

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris Ovenden (Guest)
on 2007-03-19 19:49
(Received via mailing list)
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"
Alex W. (Guest)
on 2007-03-19 19:59
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?
Chris Ovenden (Guest)
on 2007-03-19 20:11
(Received via mailing list)
On 3/19/07, Alex W. <removed_email_address@domain.invalid> 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"
Marc L. (Guest)
on 2007-03-19 20:45
(Received via mailing list)
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.
This topic is locked and can not be replied to.