summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-09-17 17:22:47 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-09-17 17:22:47 +0000
commit1d925e5cbf7ed7902dc5cbcb18b7d61a6cac57e6 (patch)
tree9c525b20f6d659229a872d7a37c58e1a583a1c39 /spec/support
parentba7f64080cc81314f6a000758aa8c572f3696322 (diff)
parent38f8f4e9fe06c0e2733e9dbab25118a0eed4eb02 (diff)
downloadgitlab-ce-1d925e5cbf7ed7902dc5cbcb18b7d61a6cac57e6.tar.gz
Merge branch 'rs-markdown-feature-parity' into 'master'
Add fixture path argument to `MarkdownFeature.new` See merge request gitlab-org/gitlab-ce!21754
Diffstat (limited to 'spec/support')
-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