Is there a nicer way to set POST body data in rspec on rails? -


than request.env['raw_post_data'] = json_body?

i'm not sure if mean, can set request headers indicate json:

  describe "post 'create'"     "should successful"       request.env["http_accept"] = "application/json"       post 'create', :article => { :title => "foo" }.to_json       response.should be_success     end   end 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -