summaryrefslogtreecommitdiff
path: root/spec/support/helpers/fixture_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/fixture_helpers.rb')
-rw-r--r--spec/support/helpers/fixture_helpers.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/helpers/fixture_helpers.rb b/spec/support/helpers/fixture_helpers.rb
new file mode 100644
index 00000000000..611d19f36a0
--- /dev/null
+++ b/spec/support/helpers/fixture_helpers.rb
@@ -0,0 +1,11 @@
+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