Skip to content

Instantly share code, notes, and snippets.

@hchood
Created March 15, 2016 12:16
Show Gist options
  • Save hchood/3c1b590ff7015589a6d0 to your computer and use it in GitHub Desktop.
Save hchood/3c1b590ff7015589a6d0 to your computer and use it in GitHub Desktop.
# spec/support/helpers/requests.rb
module Helpers
module Requests
def body
response.body
end
def json_value_at_path(path = '')
parse_json(body, path)
end
def api_version
1
end
def accept_header
"application/vnd.authentication-demo-app.com; version=#{api_version}"
end
def accept_headers
{ 'Accept' => accept_header,
'Content-Type' => 'application/json' }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment