summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-07-28 23:27:08 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-07-29 00:06:52 -0400
commit8c957b54f5a70d07a0c70f15c84cdf9fc7eb0f23 (patch)
treec72ed2b80d7677b78dd3506e3817b574e995cba0
parent05f9a6a9c44c094d281d3dc8d80eb30c4e7dff27 (diff)
downloadgitlab-ce-rs-markdown-feature-pipelines.tar.gz
Fix setup/teardown for Markdown feature specrs-markdown-feature-pipelines
Prior, CI seemed to be freezing after running these specs.
-rw-r--r--spec/features/markdown_spec.rb25
-rw-r--r--spec/support/markdown_feature.rb8
2 files changed, 9 insertions, 24 deletions
diff --git a/spec/features/markdown_spec.rb b/spec/features/markdown_spec.rb
index ddef2317e1c..859a62f740f 100644
--- a/spec/features/markdown_spec.rb
+++ b/spec/features/markdown_spec.rb
@@ -29,22 +29,6 @@ describe 'GitLab Markdown', feature: true do
include GitlabMarkdownHelper
include MarkdownMatchers
- # Let's only parse this thing once
- before(:all) do
- @feat = MarkdownFeature.new
-
- # `gfm_with_options` depends on a `@project` variable
- @project = @feat.project
- end
-
- after(:all) do
- @feat.teardown
- end
-
- def doc(html = @html)
- Nokogiri::HTML::DocumentFragment.parse(html)
- end
-
# Sometimes it can be useful to see the parsed output of the Markdown document
# for debugging. Call this method to write the output to
# `tmp/capybara/<filename>.html`.
@@ -54,6 +38,10 @@ describe 'GitLab Markdown', feature: true do
end
end
+ def doc(html = @html)
+ Nokogiri::HTML::DocumentFragment.parse(html)
+ end
+
# Shared behavior that all pipelines should exhibit
shared_examples 'all pipelines' do
describe 'Redcarpet extensions' do
@@ -189,6 +177,11 @@ describe 'GitLab Markdown', feature: true do
context 'default pipeline' do
before(:all) do
+ @feat = MarkdownFeature.new
+
+ # `gfm_with_options` depends on a `@project` variable
+ @project = @feat.project
+
@html = markdown(@feat.raw_markdown)
end
diff --git a/spec/support/markdown_feature.rb b/spec/support/markdown_feature.rb
index 5e18ffa4143..2a868aed73b 100644
--- a/spec/support/markdown_feature.rb
+++ b/spec/support/markdown_feature.rb
@@ -10,14 +10,6 @@
class MarkdownFeature
include FactoryGirl::Syntax::Methods
- def initialize
- DatabaseCleaner.start
- end
-
- def teardown
- DatabaseCleaner.clean
- end
-
def user
@user ||= create(:user)
end