I'm trying to update from rails 4.2.6 to rails 5.0.0.1 but get the following warning when running my tests:
DEPRECATION WARNING: ActionController::TestCase HTTP request methods will accept only keyword arguments in future Rails versions.
Examples:
get :show, params: { id: 1 }, session: { user_id: 1 } process :update, method: :post, params: { id: 1 } (called from block in at /home/ubuntu/workspace/my_app/test/controllers/tractions_controller_test.rb:25)
I've been making the appropriate changes to accommodate for this change. However for the integration test line below, I don't know how to change it properly:
delete api_sessions_path, { api_session: { org_id: nil } }, { "HTTP_API_TOKEN": "token", "HTTP_USER_EMAIL": @user.email }
So the test passes but with the deprecation warning. If I change it to the two options below the test fails with a syntax error. How to properly adjust the line?
delete api_sessions_path, params: { api_session: { org_id: nil } }, { "HTTP_API_TOKEN": "token", "HTTP_USER_EMAIL": @user.email }
delete api_sessions_path, params: { { api_session: { org_id: nil } }, { "HTTP_API_TOKEN": "token", "HTTP_USER_EMAIL": @user.email } }
Update: I've also tried using session
with the options below but that produces the error ArgumentError: unknown keyword: session
.
delete api_sessions_path, session: { api_session: { org_id: nil } }, params: { "HTTP_API_TOKEN": "token", "HTTP_USER_EMAIL": @user.email }
delete api_sessions_path, params: { api_session: { org_id: nil } }, session: { "HTTP_API_TOKEN": "token", "HTTP_USER_EMAIL": @user.email }
delete api_sessions_path, params: { "HTTP_API_TOKEN": "token", "HTTP_USER_EMAIL": @user.email }, session: { api_session: { org_id: nil } }
delete api_sessions_path, session: { api_session: { org_id: nil } }, { "HTTP_API_TOKEN": "token", "HTTP_USER_EMAIL": @user.email }