gitlab-org--gitlab-foss/spec/support/fixture_helpers.rb
Rémy Coutable d73458bbc5 Port some changes from gitlab-ee!4532 back to CE
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-02-14 19:22:05 +01:00

15 lines
349 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
RSpec.configure do |config|
config.include FixtureHelpers
end