gitlab-org--gitlab-foss/spec/support/helpers/fixture_helpers.rb
Rémy Coutable 023d4f6f2f
Move spec helpers/matchers/shared examples/contexts to their relevant folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-04-23 12:20:30 +02:00

11 lines
284 B
Ruby

module FixtureHelpers
def fixture_file(filename, dir: '')
return '' if filename.blank?
File.read(expand_fixture_path(filename, dir: dir))
end
def expand_fixture_path(filename, dir: '')
File.expand_path(Rails.root.join(dir, 'spec', 'fixtures', filename))
end
end