Method: Opsmgr::Teapot::SpecHelper#post

Defined in:
lib/opsmgr/teapot/spec_helper.rb

#post(path, params = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/opsmgr/teapot/spec_helper.rb', line 10

def post(path, params = {})
  req = Net::HTTP::Post.new(path)
  req.set_form_data(params)
  response = teapot_client.request(req)

  fail "Teapot gave HTTP response #{response.code} POST of #{path} with #{params.inspect}" if response.is_a?(Net::HTTPInternalServerError)

  response
end