Guest User

Untitled

a guest
Sep 24th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. resource "Order" do
  2. let(:client) { RspecApiDocumentation::TestClient.new(self, :headers => { "HTTP_ACCEPT" => "application/json", "CONTENT_TYPE" => "application/json" }) }
  3.  
  4. post "/orders" do
  5. parameter :name, "Order name"
  6.  
  7. let(:name) { "New order" }
  8.  
  9. let(:raw_post) { params.to_json }
  10.  
  11. example "Sending JSON" do
  12. do_request
  13.  
  14. response_body.should be_json_eql({ :name => name }.to_json)
  15. status.should == 201
  16. end
  17. end
  18. end
Add Comment
Please, Sign In to add comment