Module: Shark::RSpec::Helpers::Fixtures
- Included in:
- Shark::RSpec::Helpers
- Defined in:
- lib/shark/rspec/helpers/fixtures.rb
Instance Method Summary collapse
- #form_inputs_json ⇒ Object
- #form_structure_json ⇒ Object
- #load_fixture(filename) ⇒ Object
- #load_json_fixture(filename) ⇒ Object
Instance Method Details
#form_inputs_json ⇒ Object
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_json ⇒ Object
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.("../../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 |