Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

This project is archived and is in readonly mode.

ArgumentError on xhr integration tests

#702

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.

Reported by Raul Murciano · July 25th, 2008 @ 12:39 PM

State: stale
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Raul Murciano
    Raul Murciano

    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.

    July 25th, 2008 @ 06:37 PM

  2. josh
    josh
    • State changed from new to stale

    Staling out, please reopen if this is still a problem.

    October 28th, 2008 @ 04:33 PM