Sha256: 253521ba439ec2399550e8510ebd4b258a6d444b6a6d36e9137bbfcc30bd0499
Contents?: true
Size: 375 Bytes
Versions: 7
Compression:
Stored size: 375 Bytes
Contents
module Helpers module JsonHelper # Return a JSON fixture as an indifferent hash. def json_fixture(path, dir: 'json', parse: true) filename = Rails.root.join('spec', 'fixtures', 'files', dir, "#{path}.json") return File.read(filename) unless parse HashWithIndifferentAccess.new(ActiveSupport::JSON.decode(File.read(filename))) end end end
Version data entries
7 entries across 7 versions & 1 rubygems