You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exact problem is using the as: :json option to the request helpers defined in ActionDispatch::Integration:: RequestHelpers, which also seems to be the only way to correctly encode the body of your request as json. Otherwise WWWFormEncoder will be used.
using rspec-rails:
require 'rails_helper'
RSpec.describe "Authentication", :type => :request do
params = { some: "niceparams" }
headers = { 'HTTPS' => 'on'}
post "/anything", params: params, headers: headers, as: :json
end
Expected behavior
The path for the request should be left as "/anything" by default, or there should be an option to not expand the path.
Actual behavior
the path is expanded to include the format : /anything.json