Last active
June 27, 2018 08:53
-
-
Save andriy-baran/76df1355ddab1d46c2b7efa6b65ba86f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Helpers | |
def parse_json(json_data) | |
JSON.parse(json_data, symbolize_names: true) | |
end | |
def response_body | |
JSON.parse(response.body, symbolize_names: true) | |
end | |
def response_object | |
OpenStruct.new(parsed_body) | |
end | |
def response_objects | |
JSON.parse(response.body, object_class: OpenStruct) | |
end | |
end | |
RSpec.configure do |config| | |
config.include Helpers | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment