diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-05-23 09:36:41 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-05-23 09:36:41 +0000 |
commit | 8056a77d3ec9d3b4b1fd75211d6bc59fa1c65103 (patch) | |
tree | 6db59d14fc31cef143c1d49e7cdbc7a3133697b3 /spec | |
parent | 3a3f542db6dd1a406f341cb59b18d9af7956e9fd (diff) | |
download | gitlab-ce-8056a77d3ec9d3b4b1fd75211d6bc59fa1c65103.tar.gz |
Resolve "Web IDE doesn't work for branches with slashes"
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/blob_helper_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb index 8de615ad8c2..a3e010c3206 100644 --- a/spec/helpers/blob_helper_spec.rb +++ b/spec/helpers/blob_helper_spec.rb @@ -258,13 +258,19 @@ describe BlobHelper do 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/") + expect(helper.ide_edit_path(project, "master", "")).to eq("/-/ide/project/#{project.namespace.path}/#{project.path}/edit/master") + end + + it 'returns full IDE path with second -' do + Rails.application.routes.default_url_options[:script_name] = nil + + expect(helper.ide_edit_path(project, "testing/slashes", "readme.md")).to eq("/-/ide/project/#{project.namespace.path}/#{project.path}/edit/testing/slashes/-/readme.md") end it 'returns IDE path without relative_url_root' do Rails.application.routes.default_url_options[:script_name] = "/gitlab" - expect(helper.ide_edit_path(project, "master", "")).to eq("/gitlab/-/ide/project/#{project.namespace.path}/#{project.path}/edit/master/") + expect(helper.ide_edit_path(project, "master", "")).to eq("/gitlab/-/ide/project/#{project.namespace.path}/#{project.path}/edit/master") end end end |