# Assert\_select: ArgumentError: wrong number of arguments (6 f

**URL:** <https://www.ruby-forum.com/t/assert-select-argumenterror-wrong-number-of-arguments-6-f/111993>\
**Category:** Rails\
**Created:** [August 14, 2007, 3:30am UTC](https://www.ruby-forum.com/t/assert-select-argumenterror-wrong-number-of-arguments-6-f/111993 "2007-08-14T03:30:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![caiwangqin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4bbf92/32.png) [@caiwangqin](https://www.ruby-forum.com/u/caiwangqin)\
**Post date:** [August 14, 2007, 3:30am UTC](https://www.ruby-forum.com/t/assert-select-argumenterror-wrong-number-of-arguments-6-f/111993/1 "2007-08-14T03:30:37Z")

</div>

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:in `test\_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](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

---

<div class="post-metadata">

**Author:** ![caiwangqin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4bbf92/32.png) [@caiwangqin](https://www.ruby-forum.com/u/caiwangqin)\
**Post date:** [August 16, 2007, 8:54pm UTC](https://www.ruby-forum.com/t/assert-select-argumenterror-wrong-number-of-arguments-6-f/111993/2 "2007-08-16T20:54:58Z")

</div>

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](http://autopendium.com)

---

<div class="post-metadata">

**Author:** ![caiwangqin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/4bbf92/32.png) [@caiwangqin](https://www.ruby-forum.com/u/caiwangqin)\
**Post date:** [August 21, 2007, 9:58pm UTC](https://www.ruby-forum.com/t/assert-select-argumenterror-wrong-number-of-arguments-6-f/111993/3 "2007-08-21T21:58:47Z")

</div>

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/](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
