title: Rspec request specs and Rails 5
body: <p>I'm starting a new project, my first with Rails 5.1.0. I have a pb with my first request spec.</p>
  
  <pre><code>describe 'Users', type: :request do
    it 'are created from external data' do
      json_string = File.read('path/to/test_data/user_data.json')
      params = { user: JSON.parse(json_string) }
      headers = { "CONTENT_TYPE" =&gt; "application/json" }
  
      expect do
        post '/api/v1/users', params.to_s, headers
      end.to change {
        User.count
      }.by(1)
  
      expect(response.status).to eq 200
    end
  end
  </code></pre>
  
  <p>this spec return the error <code>ArgumentError: wrong number of arguments (given 3, expected 1)</code>. The <a href="https://www.relishapp.com/rspec/rspec-rails/docs/request-specs/request-spec#providing-json-data" rel="noreferrer">official documentation</a> don't say much.</p>
  
  <p>If I take out the .to_s, and send a hash, like this:</p>
  
  <pre><code>post '/api/v1/users', params, headers
  </code></pre>
  
  <p>I got another error:</p>
  
  <pre><code>ArgumentError: unknown keyword: user
  </code></pre>
  
  <p>Any thought?</p>