Module: Shark::RSpec::Helpers::Fixtures

Included in:
Shark::RSpec::Helpers
Defined in:
lib/shark/rspec/helpers/fixtures.rb

Instance Method Summary collapse

Instance Method Details

#form_inputs_jsonObject



11
12
13
# File 'lib/shark/rspec/helpers/fixtures.rb', line 11

def form_inputs_json
  load_json_fixture('form_inputs.json')
end

#form_structure_jsonObject



7
8
9
# File 'lib/shark/rspec/helpers/fixtures.rb', line 7

def form_structure_json
  load_json_fixture('form_structure.json')
end

#load_fixture(filename) ⇒ Object



19
20
21
22
# File 'lib/shark/rspec/helpers/fixtures.rb', line 19

def load_fixture(filename)
  filepath = File.expand_path("../../fixtures/#{filename}", __FILE__)
  File.read(filepath)
end

#load_json_fixture(filename) ⇒ Object



15
16
17
# File 'lib/shark/rspec/helpers/fixtures.rb', line 15

def load_json_fixture(filename)
  JSON.parse(load_fixture(filename))
end