Module: Rack::Minitest::JSON

Included in:
Minitest::Test
Defined in:
lib/rack-minitest/json.rb

Instance Method Summary collapse

Instance Method Details

#delete_json(path, params = {}, headers = {}) ⇒ Object



22
23
24
# File 'lib/rack-minitest/json.rb', line 22

def delete_json(path, params = {}, headers = {})
  json_request :delete, path, params, headers
end

#get_json(path, params = {}, headers = {}) ⇒ Object



10
11
12
# File 'lib/rack-minitest/json.rb', line 10

def get_json(path, params = {}, headers = {})
  json_request :get, path, params, headers
end

#last_json_responseObject



6
7
8
# File 'lib/rack-minitest/json.rb', line 6

def last_json_response
  ::JSON.parse(last_response.body)
end

#post_json(path, params = {}, headers = {}) ⇒ Object



14
15
16
# File 'lib/rack-minitest/json.rb', line 14

def post_json(path, params = {}, headers = {})
  json_request :post, path, params, headers
end

#put_json(path, params = {}, headers = {}) ⇒ Object



18
19
20
# File 'lib/rack-minitest/json.rb', line 18

def put_json(path, params = {}, headers = {})
  json_request :put, path, params, headers
end