Assert_select: ArgumentError: wrong number of arguments (6 f


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]”,

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

The error is:

ArgumentError: wrong number of arguments (6 for 2)






assert_select' test/functional/scheduled_posts_controller_test.rb:33:intest_should_have_add_link_selected_on_new’


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:
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


Jesse C. wrote:

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

Autopendium :: Stuff about old cars

Just answering my own question from a while back.

It turns out at some point along the way someone had installed
ruby-htmltools ( ) 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.


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