summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-11 16:32:11 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-11 16:32:11 +0200
commite3c30bf2e84462810bd8eff941681682a7ce6dc7 (patch)
treeb7755ec091db0a66292a19dc2a909bcfad4f67e9 /spec/support
parentcd606e17907071af5ddf1d844deec0365c254604 (diff)
parent4f461fd45f65dbd6900088149b48649b27a7c2ce (diff)
downloadgitlab-ce-e3c30bf2e84462810bd8eff941681682a7ce6dc7.tar.gz
Merge branch 'master' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-g
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/matchers/markdown_matchers.rb3
-rw-r--r--spec/support/relative_url.rb8
2 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/matchers/markdown_matchers.rb b/spec/support/matchers/markdown_matchers.rb
index 9df226c3af8..7500d0fdf80 100644
--- a/spec/support/matchers/markdown_matchers.rb
+++ b/spec/support/matchers/markdown_matchers.rb
@@ -27,6 +27,9 @@ module MarkdownMatchers
match do |actual|
expect(actual).to have_selector('img.emoji', count: 10)
+
+ image = actual.at_css('img.emoji')
+ expect(image['src'].to_s).to start_with(Gitlab.config.gitlab.url + '/assets')
end
end
diff --git a/spec/support/relative_url.rb b/spec/support/relative_url.rb
new file mode 100644
index 00000000000..72e3ccce75b
--- /dev/null
+++ b/spec/support/relative_url.rb
@@ -0,0 +1,8 @@
+# Fix route helpers in tests (e.g. root_path, ...)
+module RelativeUrl
+ extend ActiveSupport::Concern
+
+ included do
+ default_url_options[:script_name] = Rails.application.config.relative_url_root
+ end
+end