Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-04-25 19:27:18 +0300
committerPhil Hughes <me@iamphill.com>2018-04-25 19:27:18 +0300
commit1d9540cc0db6c9269621263b9717aaabbd306cc9 (patch)
treed90b23eb4c29f44072d13fb6ff14d62bd02613eb
parent4b1475b90851eb1e9ff9103fc0247d2d2e45d52e (diff)
restore original script_name config
-rw-r--r--spec/helpers/blob_helper_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb
index 750734be290..419dc091a62 100644
--- a/spec/helpers/blob_helper_spec.rb
+++ b/spec/helpers/blob_helper_spec.rb
@@ -246,7 +246,18 @@ describe BlobHelper do
describe '#ide_edit_path' do
let(:project) { create(:project) }
+ around(:each) do |example|
+ old_script_name = Rails.application.routes.default_url_options[:script_name]
+ begin
+ example.run
+ ensure
+ Rails.application.routes.default_url_options[:script_name] = old_script_name
+ end
+ end
+
it 'returns full IDE path' do
+ Rails.application.routes.default_url_options[:script_name] = nil
+
expect(helper.ide_edit_path(project, "master", "")).to eq("/-/ide/project/#{project.namespace.path}/#{project.path}/edit/master/")
end