This is a problem that has been bothering me for some time. I am building an API function that should receive data in json and response in json. My controller tests run fine
describe '#create' do
let(:email) {'andre'}
let(:attrs) {{email: email}}
let(:params) {{format: :json, subscription: attrs}}
it "should return an error if there is no correct email" do
post "/magazine_subscriptions", params
end
end