⌚ OpenOpeningstijden main server application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

request_helpers.rb 339B

123456789101112131415161718
  1. # frozen_string_literal: true
  2. require 'ostruct'
  3. require 'json'
  4. require 'rack/test'
  5. module RequestHelpers
  6. include Rack::Test::Methods
  7. def app
  8. Sinatra::Application
  9. end
  10. def post_json(url, body, headers = {})
  11. defaults = { 'Content-Type' => 'application/json' }
  12. post url, body.to_json, headers.merge(defaults)
  13. end
  14. end