Than request.env['RAW_POST_DATA'] = json_body
?
I'm not sure if this is what you mean, but you can set the request headers to indicate JSON:
describe "POST 'create'" do
it "should be successful" do
request.env["HTTP_ACCEPT"] = "application/json"
post 'create', :article => { :title => "Foo" }.to_json
response.should be_success
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With