Skip to content

Unable to opt-out of path expansion using ActionDispatch::Integration:: RequestHelpers #27144

@FriedSock

Description

@FriedSock

Steps to reproduce

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

System configuration

Rails version:
5.0.0.1

Ruby version:
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin14]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions