This project is archived and is in readonly mode.
ArgumentError on xhr integration tests
Reported by Raul Murciano | July 25th, 2008 @ 12:39 PM | in 2.x
When making a xhr :post call from integration tests I always get an ArgumentError:
ArgumentError: wrong number of arguments (4 for 3)
.../vendor/rails/actionpack/lib/action_controller/integration.rb:450:in `post'
.../vendor/rails/actionpack/lib/action_controller/integration.rb:450:in `send!'
.../vendor/rails/actionpack/lib/action_controller/integration.rb:450:in `post'
.../vendor/rails/actionpack/lib/action_controller/test_process.rb:400:in `send!'
.../vendor/rails/actionpack/lib/action_controller/test_process.rb:400:in `xhr'
It seems that when xml_http_request calls:
send!(request_method, action, parameters, session, flash)
the final flash argument differs from the integration session's post method signature:
def post(path, parameters = nil, headers = nil)
I can't see any reference to flash variables on integration stuff so maybe just removing the flash parameter will do the job.
Comments and changes to this ticket
-
Raul Murciano July 25th, 2008 @ 06:37 PM
I've found a similar bug on this ticket:
http://dev.rubyonrails.org/ticke...
The ticket is closed as fixed, but maybe the xhr alias is related with the problem: using xml_http_request instead xhr doesn't throw the mentioned ArgumentError and the tests work as expected.
-
josh October 28th, 2008 @ 04:33 PM
- State changed from new to stale
Staling out, please reopen if this is still a problem.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>