Rspec Controller tests, passing JSON params
问题 I'm trying to achieve the following: create a POST json request within RSpec Controller test, passing it params. Here's my code it 'returns access_token' do post :login, email: 'bla', password: 'bla1', format: :json end What I get in controllers request.body.read is a string with params, but passed like this email=bla&password=bla1 This is definitely not a JSON. But, if I make request using CURL curl -d '{"email": "bla@bla.com" }' http://127.0.0.1:3000/users/login --header "Accept: