Assert_select: ArgumentError: wrong number of arguments (6 f

Hello,

I am getting an error whenever I try to use assert_select in the
following test:

def test_should_have_add_link_selected_on_new
get :new, :user => @current_user.screen_name
assert_response :success
assert_select “input#scheduled_post_append_to_post[checked]”,
“checked”
end

I get the same error when calling the single parameter version of
assert_select:
assert_select “input#scheduled_post_append_to_post”

The error is:

ArgumentError: wrong number of arguments (6 for 2)

/Users/jesse/development/projects/magnolia/trunk/config/…/vendor/rails/actionpack/lib/action_controller/assertions/…/vendor/html-scanner/html/node.rb:199:in
`initialize’

/Users/jesse/development/projects/magnolia/trunk/config/…/vendor/rails/actionpack/lib/action_controller/assertions/…/vendor/html-scanner/html/node.rb:199:in
`parse’

/Users/jesse/development/projects/magnolia/trunk/config/…/vendor/rails/actionpack/lib/action_controller/assertions/…/vendor/html-scanner/html/document.rb:20:in
`initialize’

/Users/jesse/development/projects/magnolia/trunk/config/…/vendor/rails/actionpack/lib/action_controller/test_process.rb:439:in
`html_document’

/Users/jesse/development/projects/magnolia/trunk/config/…/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb:555:in
`response_from_page_or_rjs’

/Users/jesse/development/projects/magnolia/trunk/config/…/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb:197:in
assert_select' test/functional/scheduled_posts_controller_test.rb:33:intest_should_have_add_link_selected_on_new’

/usr/lib/ruby/gems/1.8/gems/mocha-0.4.0/lib/mocha/test_case_adapter.rb:19:in
`run’

I am clearly not passing it 6 args. I have tried to write other tests
using assert_select and this error is thrown consistently.

I found one other unresolved thread when searching the archives:
http://thread.gmane.org/gmane.comp.lang.ruby.rails/128719/focus=128724
and I have contacted the user to see if he found a resolution but I
would appreciate it if anyone else has any ideas how to resolve this
issue.

Thanks,
-Jesse

Jesse C. wrote:

`response_from_page_or_rjs’
using assert_select and this error is thrown consistently.

Not sure this is helpful, but sounds like the HTML parser that
assert_select using is having difficulty with the response. Might help
to do a “puts @response.body” before the assert_select to examine it

Hope this helps
Chris

Autopendium :: Stuff about old cars
http://autopendium.com

Just answering my own question from a while back.

It turns out at some point along the way someone had installed
ruby-htmltools ( http://bike-nomad.com/ruby/ ) in our project. This
library contains an HTML:Tag class that was clobbering the HTML:Tag
class in /action_controller/vendor/html-scanner/html .

Removing this library cleared up the problem.

-jc

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs