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

mysql - How to insert just year and month into date field? -

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -