summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2018-09-14 13:50:37 -0500
committerRobert Speicher <rspeicher@gmail.com>2018-09-14 13:50:37 -0500
commit38f8f4e9fe06c0e2733e9dbab25118a0eed4eb02 (patch)
treeda799d953fee700b3359ec527dbe6f924a067b72
parent165e9a99c0363934e7676f3968e974af73c6cf95 (diff)
downloadgitlab-ce-38f8f4e9fe06c0e2733e9dbab25118a0eed4eb02.tar.gz
Add fixture path argument to `MarkdownFeature.new`
This default will be overridden in the EE-specific subclass that uses a different fixture path.
-rw-r--r--spec/support/helpers/markdown_feature.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/support/helpers/markdown_feature.rb b/spec/support/helpers/markdown_feature.rb
index 346f5b1cc4d..96401379cf0 100644
--- a/spec/support/helpers/markdown_feature.rb
+++ b/spec/support/helpers/markdown_feature.rb
@@ -10,6 +10,12 @@
class MarkdownFeature
include FactoryBot::Syntax::Methods
+ attr_reader :fixture_path
+
+ def initialize(fixture_path = Rails.root.join('spec/fixtures/markdown.md.erb'))
+ @fixture_path = fixture_path
+ end
+
def user
@user ||= create(:user)
end
@@ -122,7 +128,7 @@ class MarkdownFeature
end
def raw_markdown
- markdown = File.read(Rails.root.join('spec/fixtures/markdown.md.erb'))
+ markdown = File.read(fixture_path)
ERB.new(markdown).result(binding)
end
end