summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyasonik <syasonik@gitlab.com>2019-07-25 13:12:03 +0300
committersyasonik <syasonik@gitlab.com>2019-07-25 13:12:03 +0300
commit3fda6667a5340100e35cf708ba0aec9486ab9fc4 (patch)
tree8491aff6210179e8738498ddcee78a5371e24b3b
parent073cc653371eda9e18c45931070bf9fe37adf083 (diff)
downloadgitlab-ce-tr-embed-metrics-feature-test.tar.gz
Restore host after teststr-embed-metrics-feature-test
-rw-r--r--spec/features/markdown/metrics_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/features/markdown/metrics_spec.rb b/spec/features/markdown/metrics_spec.rb
index cf31e765028..aa53ac50c78 100644
--- a/spec/features/markdown/metrics_spec.rb
+++ b/spec/features/markdown/metrics_spec.rb
@@ -22,6 +22,10 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching do
sign_in(user)
end
+ after do
+ restore_host
+ end
+
context 'with deployments and related deployable present' do
it 'shows embedded metrics' do
visit project_issue_path(project, issue)
@@ -37,6 +41,9 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching do
end
def configure_host
+ @original_default_host = default_url_options[:host]
+ @original_gitlab_url = Gitlab.config.gitlab[:url]
+
# Ensure we create a metrics url with the right host.
# Configure host for route helpers in specs (also updates root_url):
default_url_options[:host] = Capybara.server_host
@@ -45,4 +52,9 @@ describe 'Metrics rendering', :js, :use_clean_rails_memory_store_caching do
# Configure host to include port in app:
Gitlab.config.gitlab[:url] = root_url.chomp('/')
end
+
+ def restore_host
+ default_url_options[:host] = @original_default_host
+ Gitlab.config.gitlab[:url] = @original_gitlab_url
+ end
end