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.