Skip to content

Instantly share code, notes, and snippets.

View Leoxxid's full-sized avatar

Leonardo de Almeida Rocha Leoxxid

View GitHub Profile
@Leoxxid
Leoxxid / api_helpers.rb
Created October 31, 2018 20:01
Rspec Configuration Example
# support/api_helpers.rb
module ApiHelpers
def json_body
JSON.parse(response.body)
end
def set_api_headers
request.headers['Accept'] = 'application/vnd.api+json;'
request.headers['X-Access-Token'] = @user.authentication_token
request.headers['X-User-Email'] = @user.email