diff options
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/banzai/filter/relative_link_filter_spec.rb | 38 | ||||
-rw-r--r-- | spec/lib/gitlab/conflict/file_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/data_builder/pipeline_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/middleware/go_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/url_builder_spec.rb | 6 |
6 files changed, 27 insertions, 27 deletions
diff --git a/spec/lib/banzai/filter/relative_link_filter_spec.rb b/spec/lib/banzai/filter/relative_link_filter_spec.rb index 500df24ece8..a17a645d4d0 100644 --- a/spec/lib/banzai/filter/relative_link_filter_spec.rb +++ b/spec/lib/banzai/filter/relative_link_filter_spec.rb @@ -153,11 +153,11 @@ describe Banzai::Filter::RelativeLinkFilter do it 'rebuilds absolute URL for a file in the repo' do doc = filter(link('/doc/api/README.md')) expect(doc.at_css('a')['href']) - .to eq "/#{project_path}/-/blob/#{ref}/doc/api/README.md" + .to eq "/#{project_path}/blob/#{ref}/doc/api/README.md" end it 'does not modify relative URLs in system notes' do - path = "#{project_path}/-/merge_requests/1/diffs" + path = "#{project_path}/merge_requests/1/diffs" doc = filter(link(path), system_note: true) expect(doc.at_css('a')['href']).to eq path @@ -171,13 +171,13 @@ describe Banzai::Filter::RelativeLinkFilter do it 'rebuilds relative URL for a file in the repo' do doc = filter(link('doc/api/README.md')) expect(doc.at_css('a')['href']) - .to eq "/#{project_path}/-/blob/#{ref}/doc/api/README.md" + .to eq "/#{project_path}/blob/#{ref}/doc/api/README.md" end it 'rebuilds relative URL for a file in the repo with leading ./' do doc = filter(link('./doc/api/README.md')) expect(doc.at_css('a')['href']) - .to eq "/#{project_path}/-/blob/#{ref}/doc/api/README.md" + .to eq "/#{project_path}/blob/#{ref}/doc/api/README.md" end it 'rebuilds relative URL for a file in the repo up one directory' do @@ -185,7 +185,7 @@ describe Banzai::Filter::RelativeLinkFilter do doc = filter(relative_link, requested_path: 'doc/update/7.14-to-8.0.md') expect(doc.at_css('a')['href']) - .to eq "/#{project_path}/-/blob/#{ref}/doc/api/README.md" + .to eq "/#{project_path}/blob/#{ref}/doc/api/README.md" end it 'rebuilds relative URL for a file in the repo up multiple directories' do @@ -193,7 +193,7 @@ describe Banzai::Filter::RelativeLinkFilter do doc = filter(relative_link, requested_path: 'doc/foo/bar/baz/README.md') expect(doc.at_css('a')['href']) - .to eq "/#{project_path}/-/blob/#{ref}/doc/api/README.md" + .to eq "/#{project_path}/blob/#{ref}/doc/api/README.md" end it 'rebuilds relative URL for a file in the repository root' do @@ -201,47 +201,47 @@ describe Banzai::Filter::RelativeLinkFilter do doc = filter(relative_link, requested_path: 'doc/some-file.md') expect(doc.at_css('a')['href']) - .to eq "/#{project_path}/-/blob/#{ref}/README.md" + .to eq "/#{project_path}/blob/#{ref}/README.md" end it 'rebuilds relative URL for a file in the repo with an anchor' do doc = filter(link('README.md#section')) expect(doc.at_css('a')['href']) - .to eq "/#{project_path}/-/blob/#{ref}/README.md#section" + .to eq "/#{project_path}/blob/#{ref}/README.md#section" end it 'rebuilds relative URL for a directory in the repo' do doc = filter(link('doc/api/')) expect(doc.at_css('a')['href']) - .to eq "/#{project_path}/-/tree/#{ref}/doc/api" + .to eq "/#{project_path}/tree/#{ref}/doc/api" end it 'rebuilds relative URL for an image in the repo' do doc = filter(image('files/images/logo-black.png')) expect(doc.at_css('img')['src']) - .to eq "/#{project_path}/-/raw/#{ref}/files/images/logo-black.png" + .to eq "/#{project_path}/raw/#{ref}/files/images/logo-black.png" end it 'rebuilds relative URL for link to an image in the repo' do doc = filter(link('files/images/logo-black.png')) expect(doc.at_css('a')['href']) - .to eq "/#{project_path}/-/raw/#{ref}/files/images/logo-black.png" + .to eq "/#{project_path}/raw/#{ref}/files/images/logo-black.png" end it 'rebuilds relative URL for a video in the repo' do doc = filter(video('files/videos/intro.mp4'), commit: project.commit('video'), ref: 'video') expect(doc.at_css('video')['src']) - .to eq "/#{project_path}/-/raw/video/files/videos/intro.mp4" + .to eq "/#{project_path}/raw/video/files/videos/intro.mp4" end it 'rebuilds relative URL for audio in the repo' do doc = filter(audio('files/audio/sample.wav'), commit: project.commit('audio'), ref: 'audio') expect(doc.at_css('audio')['src']) - .to eq "/#{project_path}/-/raw/audio/files/audio/sample.wav" + .to eq "/#{project_path}/raw/audio/files/audio/sample.wav" end it 'does not modify relative URL with an anchor only' do @@ -268,7 +268,7 @@ describe Banzai::Filter::RelativeLinkFilter do allow_any_instance_of(described_class).to receive(:uri_type).and_return(:raw) doc = filter(image(escaped)) - expect(doc.at_css('img')['src']).to eq "/#{project_path}/-/raw/#{Addressable::URI.escape(ref)}/#{escaped}" + expect(doc.at_css('img')['src']).to eq "/#{project_path}/raw/#{Addressable::URI.escape(ref)}/#{escaped}" end context 'when requested path is a file in the repo' do @@ -276,7 +276,7 @@ describe Banzai::Filter::RelativeLinkFilter do it 'rebuilds URL relative to the containing directory' do doc = filter(link('users.md')) - expect(doc.at_css('a')['href']).to eq "/#{project_path}/-/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md" + expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md" end end @@ -285,7 +285,7 @@ describe Banzai::Filter::RelativeLinkFilter do it 'rebuilds URL relative to the directory' do doc = filter(link('users.md')) - expect(doc.at_css('a')['href']).to eq "/#{project_path}/-/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md" + expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/doc/api/users.md" end end @@ -296,7 +296,7 @@ describe Banzai::Filter::RelativeLinkFilter do it 'correctly escapes the ref' do doc = filter(link('.gitkeep')) - expect(doc.at_css('a')['href']).to eq "/#{project_path}/-/blob/#{Addressable::URI.escape(ref)}/foo/bar/.gitkeep" + expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/foo/bar/.gitkeep" end end @@ -315,7 +315,7 @@ describe Banzai::Filter::RelativeLinkFilter do doc = filter(link(path)) expect(doc.at_css('a')['href']) - .to eq "/#{project_path}/-/raw/#{ref_escaped}/files/images/logo-black.png" + .to eq "/#{project_path}/raw/#{ref_escaped}/files/images/logo-black.png" end end @@ -326,7 +326,7 @@ describe Banzai::Filter::RelativeLinkFilter do it 'does not escape the space twice' do doc = filter(link('README.md')) - expect(doc.at_css('a')['href']).to eq "/#{project_path}/-/blob/#{Addressable::URI.escape(ref)}/with%20space/README.md" + expect(doc.at_css('a')['href']).to eq "/#{project_path}/blob/#{Addressable::URI.escape(ref)}/with%20space/README.md" end end end diff --git a/spec/lib/gitlab/conflict/file_spec.rb b/spec/lib/gitlab/conflict/file_spec.rb index 7ecc42ea497..adf5a232a75 100644 --- a/spec/lib/gitlab/conflict/file_spec.rb +++ b/spec/lib/gitlab/conflict/file_spec.rb @@ -258,7 +258,7 @@ FILE describe '#as_json' do it 'includes the blob path for the file' do expect(conflict_file.as_json[:blob_path]) - .to eq("/#{project.full_path}/-/blob/#{our_commit.oid}/files/ruby/regex.rb") + .to eq("/#{project.full_path}/blob/#{our_commit.oid}/files/ruby/regex.rb") end it 'includes the blob icon for the file' do diff --git a/spec/lib/gitlab/data_builder/pipeline_spec.rb b/spec/lib/gitlab/data_builder/pipeline_spec.rb index 86ab7f888ca..635bf56b72e 100644 --- a/spec/lib/gitlab/data_builder/pipeline_spec.rb +++ b/spec/lib/gitlab/data_builder/pipeline_spec.rb @@ -77,7 +77,7 @@ describe Gitlab::DataBuilder::Pipeline do expect(merge_request_attrs[:target_project_id]).to eq(merge_request.target_project_id) expect(merge_request_attrs[:state]).to eq(merge_request.state) expect(merge_request_attrs[:merge_status]).to eq(merge_request.merge_status) - expect(merge_request_attrs[:url]).to eq("http://localhost/#{merge_request.target_project.full_path}/-/merge_requests/#{merge_request.iid}") + expect(merge_request_attrs[:url]).to eq("http://localhost/#{merge_request.target_project.full_path}/merge_requests/#{merge_request.iid}") end end end diff --git a/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb b/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb index 7128689e362..9f8542a76c9 100644 --- a/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb @@ -75,8 +75,8 @@ describe Gitlab::DependencyLinker::GodepsJsonLinker do end it 'links GitLab projects' do - expect(subject).to include(link('gitlab.com/group/project/path', 'https://gitlab.com/group/project/-/tree/master/path')) - expect(subject).to include(link('gitlab.com/group/subgroup/project.git/path', 'https://gitlab.com/group/subgroup/project/-/tree/master/path')) + expect(subject).to include(link('gitlab.com/group/project/path', 'https://gitlab.com/group/project/tree/master/path')) + expect(subject).to include(link('gitlab.com/group/subgroup/project.git/path', 'https://gitlab.com/group/subgroup/project/tree/master/path')) end it 'links Golang packages' do diff --git a/spec/lib/gitlab/middleware/go_spec.rb b/spec/lib/gitlab/middleware/go_spec.rb index 99c2a364dfc..2b90035d148 100644 --- a/spec/lib/gitlab/middleware/go_spec.rb +++ b/spec/lib/gitlab/middleware/go_spec.rb @@ -241,7 +241,7 @@ describe Gitlab::Middleware::Go do project_url = "http://#{Gitlab.config.gitlab.host}/#{path}" expect(response[0]).to eq(200) expect(response[1]['Content-Type']).to eq('text/html') - expected_body = %{<html><head><meta name="go-import" content="#{Gitlab.config.gitlab.host}/#{path} git #{repository_url}" /><meta name="go-source" content="#{Gitlab.config.gitlab.host}/#{path} #{project_url} #{project_url}/-/tree/#{branch}{/dir} #{project_url}/-/blob/#{branch}{/dir}/{file}#L{line}" /></head><body>go get #{Gitlab.config.gitlab.url}/#{path}</body></html>} + expected_body = %{<html><head><meta name="go-import" content="#{Gitlab.config.gitlab.host}/#{path} git #{repository_url}" /><meta name="go-source" content="#{Gitlab.config.gitlab.host}/#{path} #{project_url} #{project_url}/tree/#{branch}{/dir} #{project_url}/blob/#{branch}{/dir}/{file}#L{line}" /></head><body>go get #{Gitlab.config.gitlab.url}/#{path}</body></html>} expect(response[2].body).to eq([expected_body]) end end diff --git a/spec/lib/gitlab/url_builder_spec.rb b/spec/lib/gitlab/url_builder_spec.rb index d349c2928b0..0aab02b6c4c 100644 --- a/spec/lib/gitlab/url_builder_spec.rb +++ b/spec/lib/gitlab/url_builder_spec.rb @@ -55,7 +55,7 @@ describe Gitlab::UrlBuilder do url = described_class.build(merge_request) - expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/-/merge_requests/#{merge_request.iid}" + expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/merge_requests/#{merge_request.iid}" end end @@ -118,7 +118,7 @@ describe Gitlab::UrlBuilder do url = described_class.build(note) - expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/-/merge_requests/#{merge_request.iid}#note_#{note.id}" + expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/merge_requests/#{merge_request.iid}#note_#{note.id}" end end @@ -129,7 +129,7 @@ describe Gitlab::UrlBuilder do url = described_class.build(note) - expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/-/merge_requests/#{merge_request.iid}#note_#{note.id}" + expect(url).to eq "#{Settings.gitlab['url']}/#{merge_request.project.full_path}/merge_requests/#{merge_request.iid}#note_#{note.id}" end end |