Skip to content

Instantly share code, notes, and snippets.

@andriy-baran

andriy-baran/helpers_v1.rb

Last active Jun 27, 2018
Embed
What would you like to do?
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