Skip to content
Snippets Groups Projects
Commit 7f833087 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent bbe24306
No related branches found
No related tags found
No related merge requests found
Showing
with 102 additions and 122 deletions
Loading
@@ -30,7 +30,7 @@ describe('noteActions', () => {
Loading
@@ -30,7 +30,7 @@ describe('noteActions', () => {
canAwardEmoji: true, canAwardEmoji: true,
canReportAsAbuse: true, canReportAsAbuse: true,
noteId: '539', noteId: '539',
noteUrl: `${TEST_HOST}/group/project/-/merge_requests/1#note_1`, noteUrl: `${TEST_HOST}/group/project/merge_requests/1#note_1`,
reportAbusePath: `${TEST_HOST}/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F7%23note_539&user_id=26`, reportAbusePath: `${TEST_HOST}/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F7%23note_539&user_id=26`,
showReply: false, showReply: false,
}; };
Loading
Loading
Loading
@@ -38,11 +38,11 @@ describe('DiffViewer', () => {
Loading
@@ -38,11 +38,11 @@ describe('DiffViewer', () => {
   
setTimeout(() => { setTimeout(() => {
expect(vm.$el.querySelector('.deleted img').getAttribute('src')).toBe( expect(vm.$el.querySelector('.deleted img').getAttribute('src')).toBe(
`//-/raw/DEF/${RED_BOX_IMAGE_URL}`, `//raw/DEF/${RED_BOX_IMAGE_URL}`,
); );
   
expect(vm.$el.querySelector('.added img').getAttribute('src')).toBe( expect(vm.$el.querySelector('.added img').getAttribute('src')).toBe(
`//-/raw/ABC/${GREEN_BOX_IMAGE_URL}`, `//raw/ABC/${GREEN_BOX_IMAGE_URL}`,
); );
   
done(); done();
Loading
Loading
Loading
@@ -153,11 +153,11 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -153,11 +153,11 @@ describe Banzai::Filter::RelativeLinkFilter do
it 'rebuilds absolute URL for a file in the repo' do it 'rebuilds absolute URL for a file in the repo' do
doc = filter(link('/doc/api/README.md')) doc = filter(link('/doc/api/README.md'))
expect(doc.at_css('a')['href']) 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 end
   
it 'does not modify relative URLs in system notes' do 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) doc = filter(link(path), system_note: true)
   
expect(doc.at_css('a')['href']).to eq path expect(doc.at_css('a')['href']).to eq path
Loading
@@ -171,13 +171,13 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -171,13 +171,13 @@ describe Banzai::Filter::RelativeLinkFilter do
it 'rebuilds relative URL for a file in the repo' do it 'rebuilds relative URL for a file in the repo' do
doc = filter(link('doc/api/README.md')) doc = filter(link('doc/api/README.md'))
expect(doc.at_css('a')['href']) 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 end
   
it 'rebuilds relative URL for a file in the repo with leading ./' do it 'rebuilds relative URL for a file in the repo with leading ./' do
doc = filter(link('./doc/api/README.md')) doc = filter(link('./doc/api/README.md'))
expect(doc.at_css('a')['href']) 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 end
   
it 'rebuilds relative URL for a file in the repo up one directory' do it 'rebuilds relative URL for a file in the repo up one directory' do
Loading
@@ -185,7 +185,7 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -185,7 +185,7 @@ describe Banzai::Filter::RelativeLinkFilter do
doc = filter(relative_link, requested_path: 'doc/update/7.14-to-8.0.md') doc = filter(relative_link, requested_path: 'doc/update/7.14-to-8.0.md')
   
expect(doc.at_css('a')['href']) 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 end
   
it 'rebuilds relative URL for a file in the repo up multiple directories' do it 'rebuilds relative URL for a file in the repo up multiple directories' do
Loading
@@ -193,7 +193,7 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -193,7 +193,7 @@ describe Banzai::Filter::RelativeLinkFilter do
doc = filter(relative_link, requested_path: 'doc/foo/bar/baz/README.md') doc = filter(relative_link, requested_path: 'doc/foo/bar/baz/README.md')
   
expect(doc.at_css('a')['href']) 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 end
   
it 'rebuilds relative URL for a file in the repository root' do it 'rebuilds relative URL for a file in the repository root' do
Loading
@@ -201,47 +201,47 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -201,47 +201,47 @@ describe Banzai::Filter::RelativeLinkFilter do
doc = filter(relative_link, requested_path: 'doc/some-file.md') doc = filter(relative_link, requested_path: 'doc/some-file.md')
   
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/-/blob/#{ref}/README.md" .to eq "/#{project_path}/blob/#{ref}/README.md"
end end
   
it 'rebuilds relative URL for a file in the repo with an anchor' do it 'rebuilds relative URL for a file in the repo with an anchor' do
doc = filter(link('README.md#section')) doc = filter(link('README.md#section'))
expect(doc.at_css('a')['href']) 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 end
   
it 'rebuilds relative URL for a directory in the repo' do it 'rebuilds relative URL for a directory in the repo' do
doc = filter(link('doc/api/')) doc = filter(link('doc/api/'))
expect(doc.at_css('a')['href']) expect(doc.at_css('a')['href'])
.to eq "/#{project_path}/-/tree/#{ref}/doc/api" .to eq "/#{project_path}/tree/#{ref}/doc/api"
end end
   
it 'rebuilds relative URL for an image in the repo' do it 'rebuilds relative URL for an image in the repo' do
doc = filter(image('files/images/logo-black.png')) doc = filter(image('files/images/logo-black.png'))
   
expect(doc.at_css('img')['src']) 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 end
   
it 'rebuilds relative URL for link to an image in the repo' do it 'rebuilds relative URL for link to an image in the repo' do
doc = filter(link('files/images/logo-black.png')) doc = filter(link('files/images/logo-black.png'))
   
expect(doc.at_css('a')['href']) 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 end
   
it 'rebuilds relative URL for a video in the repo' do it 'rebuilds relative URL for a video in the repo' do
doc = filter(video('files/videos/intro.mp4'), commit: project.commit('video'), ref: 'video') doc = filter(video('files/videos/intro.mp4'), commit: project.commit('video'), ref: 'video')
   
expect(doc.at_css('video')['src']) 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 end
   
it 'rebuilds relative URL for audio in the repo' do it 'rebuilds relative URL for audio in the repo' do
doc = filter(audio('files/audio/sample.wav'), commit: project.commit('audio'), ref: 'audio') doc = filter(audio('files/audio/sample.wav'), commit: project.commit('audio'), ref: 'audio')
   
expect(doc.at_css('audio')['src']) 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 end
   
it 'does not modify relative URL with an anchor only' do it 'does not modify relative URL with an anchor only' do
Loading
@@ -268,7 +268,7 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -268,7 +268,7 @@ describe Banzai::Filter::RelativeLinkFilter do
allow_any_instance_of(described_class).to receive(:uri_type).and_return(:raw) allow_any_instance_of(described_class).to receive(:uri_type).and_return(:raw)
   
doc = filter(image(escaped)) 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 end
   
context 'when requested path is a file in the repo' do context 'when requested path is a file in the repo' do
Loading
@@ -276,7 +276,7 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -276,7 +276,7 @@ describe Banzai::Filter::RelativeLinkFilter do
   
it 'rebuilds URL relative to the containing directory' do it 'rebuilds URL relative to the containing directory' do
doc = filter(link('users.md')) 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
end end
   
Loading
@@ -285,7 +285,7 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -285,7 +285,7 @@ describe Banzai::Filter::RelativeLinkFilter do
   
it 'rebuilds URL relative to the directory' do it 'rebuilds URL relative to the directory' do
doc = filter(link('users.md')) 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
end end
   
Loading
@@ -296,7 +296,7 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -296,7 +296,7 @@ describe Banzai::Filter::RelativeLinkFilter do
   
it 'correctly escapes the ref' do it 'correctly escapes the ref' do
doc = filter(link('.gitkeep')) 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
end end
   
Loading
@@ -315,7 +315,7 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -315,7 +315,7 @@ describe Banzai::Filter::RelativeLinkFilter do
doc = filter(link(path)) doc = filter(link(path))
   
expect(doc.at_css('a')['href']) 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
end end
   
Loading
@@ -326,7 +326,7 @@ describe Banzai::Filter::RelativeLinkFilter do
Loading
@@ -326,7 +326,7 @@ describe Banzai::Filter::RelativeLinkFilter do
   
it 'does not escape the space twice' do it 'does not escape the space twice' do
doc = filter(link('README.md')) 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 end
end end
Loading
Loading
Loading
@@ -258,7 +258,7 @@ FILE
Loading
@@ -258,7 +258,7 @@ FILE
describe '#as_json' do describe '#as_json' do
it 'includes the blob path for the file' do it 'includes the blob path for the file' do
expect(conflict_file.as_json[:blob_path]) 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 end
   
it 'includes the blob icon for the file' do it 'includes the blob icon for the file' do
Loading
Loading
Loading
@@ -77,7 +77,7 @@ describe Gitlab::DataBuilder::Pipeline do
Loading
@@ -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[:target_project_id]).to eq(merge_request.target_project_id)
expect(merge_request_attrs[:state]).to eq(merge_request.state) 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[: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 end
end end
Loading
Loading
Loading
@@ -75,8 +75,8 @@ describe Gitlab::DependencyLinker::GodepsJsonLinker do
Loading
@@ -75,8 +75,8 @@ describe Gitlab::DependencyLinker::GodepsJsonLinker do
end end
   
it 'links GitLab projects' do 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/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/subgroup/project.git/path', 'https://gitlab.com/group/subgroup/project/tree/master/path'))
end end
   
it 'links Golang packages' do it 'links Golang packages' do
Loading
Loading
Loading
@@ -241,7 +241,7 @@ describe Gitlab::Middleware::Go do
Loading
@@ -241,7 +241,7 @@ describe Gitlab::Middleware::Go do
project_url = "http://#{Gitlab.config.gitlab.host}/#{path}" project_url = "http://#{Gitlab.config.gitlab.host}/#{path}"
expect(response[0]).to eq(200) expect(response[0]).to eq(200)
expect(response[1]['Content-Type']).to eq('text/html') 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]) expect(response[2].body).to eq([expected_body])
end end
end end
Loading
Loading
Loading
@@ -55,7 +55,7 @@ describe Gitlab::UrlBuilder do
Loading
@@ -55,7 +55,7 @@ describe Gitlab::UrlBuilder do
   
url = described_class.build(merge_request) 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
end end
   
Loading
@@ -118,7 +118,7 @@ describe Gitlab::UrlBuilder do
Loading
@@ -118,7 +118,7 @@ describe Gitlab::UrlBuilder do
   
url = described_class.build(note) 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
end end
   
Loading
@@ -129,7 +129,7 @@ describe Gitlab::UrlBuilder do
Loading
@@ -129,7 +129,7 @@ describe Gitlab::UrlBuilder do
   
url = described_class.build(note) 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
end end
   
Loading
Loading
Loading
@@ -52,7 +52,7 @@ describe ChatMessage::MergeMessage do
Loading
@@ -52,7 +52,7 @@ describe ChatMessage::MergeMessage do
context 'open' do context 'open' do
it 'returns a message regarding opening of merge requests' do it 'returns a message regarding opening of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) opened <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> in <http://somewhere.com|project_name>') 'Test User (test.user) opened <http://somewhere.com/merge_requests/100|!100 *Merge Request title*> in <http://somewhere.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
end end
Loading
@@ -63,7 +63,7 @@ describe ChatMessage::MergeMessage do
Loading
@@ -63,7 +63,7 @@ describe ChatMessage::MergeMessage do
end end
it 'returns a message regarding closing of merge requests' do it 'returns a message regarding closing of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) closed <http://somewhere.com/-/merge_requests/100|!100 *Merge Request title*> in <http://somewhere.com|project_name>') 'Test User (test.user) closed <http://somewhere.com/merge_requests/100|!100 *Merge Request title*> in <http://somewhere.com|project_name>')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
end end
end end
Loading
@@ -77,12 +77,12 @@ describe ChatMessage::MergeMessage do
Loading
@@ -77,12 +77,12 @@ describe ChatMessage::MergeMessage do
context 'open' do context 'open' do
it 'returns a message regarding opening of merge requests' do it 'returns a message regarding opening of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) opened [!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100) in [project_name](http://somewhere.com)') 'Test User (test.user) opened [!100 *Merge Request title*](http://somewhere.com/merge_requests/100) in [project_name](http://somewhere.com)')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
expect(subject.activity).to eq({ expect(subject.activity).to eq({
title: 'Merge Request opened by Test User (test.user)', title: 'Merge Request opened by Test User (test.user)',
subtitle: 'in [project_name](http://somewhere.com)', subtitle: 'in [project_name](http://somewhere.com)',
text: '[!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100)', text: '[!100 *Merge Request title*](http://somewhere.com/merge_requests/100)',
image: 'http://someavatar.com' image: 'http://someavatar.com'
}) })
end end
Loading
@@ -95,12 +95,12 @@ describe ChatMessage::MergeMessage do
Loading
@@ -95,12 +95,12 @@ describe ChatMessage::MergeMessage do
   
it 'returns a message regarding closing of merge requests' do it 'returns a message regarding closing of merge requests' do
expect(subject.pretext).to eq( expect(subject.pretext).to eq(
'Test User (test.user) closed [!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100) in [project_name](http://somewhere.com)') 'Test User (test.user) closed [!100 *Merge Request title*](http://somewhere.com/merge_requests/100) in [project_name](http://somewhere.com)')
expect(subject.attachments).to be_empty expect(subject.attachments).to be_empty
expect(subject.activity).to eq({ expect(subject.activity).to eq({
title: 'Merge Request closed by Test User (test.user)', title: 'Merge Request closed by Test User (test.user)',
subtitle: 'in [project_name](http://somewhere.com)', subtitle: 'in [project_name](http://somewhere.com)',
text: '[!100 *Merge Request title*](http://somewhere.com/-/merge_requests/100)', text: '[!100 *Merge Request title*](http://somewhere.com/merge_requests/100)',
image: 'http://someavatar.com' image: 'http://someavatar.com'
}) })
end end
Loading
Loading
Loading
@@ -697,7 +697,7 @@ describe Project do
Loading
@@ -697,7 +697,7 @@ describe Project do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
   
it 'returns the README' do it 'returns the README' do
expect(project.readme_url).to eq("#{project.web_url}/-/blob/master/README.md") expect(project.readme_url).to eq("#{project.web_url}/blob/master/README.md")
end end
end end
end end
Loading
Loading
Loading
@@ -21,7 +21,7 @@ describe BlobPresenter, :seed_helper do
Loading
@@ -21,7 +21,7 @@ describe BlobPresenter, :seed_helper do
   
subject { described_class.new(blob) } subject { described_class.new(blob) }
   
it { expect(subject.web_url).to eq("http://localhost/#{project.full_path}/-/blob/#{blob.commit_id}/#{blob.path}") } it { expect(subject.web_url).to eq("http://localhost/#{project.full_path}/blob/#{blob.commit_id}/#{blob.path}") }
end end
   
describe '#highlight' do describe '#highlight' do
Loading
Loading
Loading
@@ -101,7 +101,7 @@ describe MergeRequestPresenter do
Loading
@@ -101,7 +101,7 @@ describe MergeRequestPresenter do
allow(presenter).to receive_message_chain(:conflicts, :can_be_resolved_by?).with(user) { true } allow(presenter).to receive_message_chain(:conflicts, :can_be_resolved_by?).with(user) { true }
   
expect(path) expect(path)
.to eq("/#{project.full_path}/-/merge_requests/#{resource.iid}/conflicts") .to eq("/#{project.full_path}/merge_requests/#{resource.iid}/conflicts")
end end
end end
end end
Loading
@@ -179,7 +179,7 @@ describe MergeRequestPresenter do
Loading
@@ -179,7 +179,7 @@ describe MergeRequestPresenter do
   
it 'returns correct link with correct text' do it 'returns correct link with correct text' do
is_expected is_expected
.to match("#{project.full_path}/-/merge_requests/#{resource.iid}/assign_related_issues") .to match("#{project.full_path}/merge_requests/#{resource.iid}/assign_related_issues")
   
is_expected is_expected
.to match("Assign yourself to this issue") .to match("Assign yourself to this issue")
Loading
@@ -192,7 +192,7 @@ describe MergeRequestPresenter do
Loading
@@ -192,7 +192,7 @@ describe MergeRequestPresenter do
   
it 'returns correct link with correct text' do it 'returns correct link with correct text' do
is_expected is_expected
.to match("#{project.full_path}/-/merge_requests/#{resource.iid}/assign_related_issues") .to match("#{project.full_path}/merge_requests/#{resource.iid}/assign_related_issues")
   
is_expected is_expected
.to match("Assign yourself to these issues") .to match("Assign yourself to these issues")
Loading
@@ -221,7 +221,7 @@ describe MergeRequestPresenter do
Loading
@@ -221,7 +221,7 @@ describe MergeRequestPresenter do
.with(user) .with(user)
.and_return(true) .and_return(true)
   
is_expected.to eq("/#{resource.project.full_path}/-/merge_requests/#{resource.iid}/cancel_auto_merge") is_expected.to eq("/#{resource.project.full_path}/merge_requests/#{resource.iid}/cancel_auto_merge")
end end
end end
   
Loading
@@ -248,7 +248,7 @@ describe MergeRequestPresenter do
Loading
@@ -248,7 +248,7 @@ describe MergeRequestPresenter do
.and_return(true) .and_return(true)
   
is_expected is_expected
.to eq("/#{resource.project.full_path}/-/merge_requests/#{resource.iid}/merge") .to eq("/#{resource.project.full_path}/merge_requests/#{resource.iid}/merge")
end end
end end
   
Loading
@@ -312,7 +312,7 @@ describe MergeRequestPresenter do
Loading
@@ -312,7 +312,7 @@ describe MergeRequestPresenter do
project.add_maintainer(user) project.add_maintainer(user)
   
is_expected is_expected
.to eq("/#{resource.project.full_path}/-/merge_requests/#{resource.iid}/remove_wip") .to eq("/#{resource.project.full_path}/merge_requests/#{resource.iid}/remove_wip")
end end
end end
   
Loading
@@ -334,7 +334,7 @@ describe MergeRequestPresenter do
Loading
@@ -334,7 +334,7 @@ describe MergeRequestPresenter do
allow(resource).to receive(:target_branch_exists?) { true } allow(resource).to receive(:target_branch_exists?) { true }
   
is_expected is_expected
.to eq("/#{resource.target_project.full_path}/-/commits/#{resource.target_branch}") .to eq("/#{resource.target_project.full_path}/commits/#{resource.target_branch}")
end end
end end
   
Loading
@@ -358,7 +358,7 @@ describe MergeRequestPresenter do
Loading
@@ -358,7 +358,7 @@ describe MergeRequestPresenter do
allow(resource).to receive(:source_branch_exists?) { true } allow(resource).to receive(:source_branch_exists?) { true }
   
is_expected is_expected
.to eq("/#{resource.source_project.full_path}/-/commits/#{resource.source_branch}") .to eq("/#{resource.source_project.full_path}/commits/#{resource.source_branch}")
end end
end end
   
Loading
@@ -382,7 +382,7 @@ describe MergeRequestPresenter do
Loading
@@ -382,7 +382,7 @@ describe MergeRequestPresenter do
allow(resource).to receive(:target_branch_exists?) { true } allow(resource).to receive(:target_branch_exists?) { true }
   
is_expected is_expected
.to eq("/#{resource.target_project.full_path}/-/tree/#{resource.target_branch}") .to eq("/#{resource.target_project.full_path}/tree/#{resource.target_branch}")
end end
end end
   
Loading
@@ -496,7 +496,7 @@ describe MergeRequestPresenter do
Loading
@@ -496,7 +496,7 @@ describe MergeRequestPresenter do
allow(resource).to receive(:source_branch_exists?) { true } allow(resource).to receive(:source_branch_exists?) { true }
   
is_expected is_expected
.to eq("<a href=\"/#{resource.source_project.full_path}/-/tree/#{resource.source_branch}\">#{resource.source_branch}</a>") .to eq("<a href=\"/#{resource.source_project.full_path}/tree/#{resource.source_branch}\">#{resource.source_branch}</a>")
end end
   
it 'escapes html, when source_branch does not exist' do it 'escapes html, when source_branch does not exist' do
Loading
@@ -535,7 +535,7 @@ describe MergeRequestPresenter do
Loading
@@ -535,7 +535,7 @@ describe MergeRequestPresenter do
   
it 'returns path' do it 'returns path' do
is_expected is_expected
.to eq("/#{project.full_path}/-/merge_requests/#{resource.iid}/rebase") .to eq("/#{project.full_path}/merge_requests/#{resource.iid}/rebase")
end end
end end
   
Loading
Loading
Loading
@@ -11,6 +11,6 @@ describe TreeEntryPresenter do
Loading
@@ -11,6 +11,6 @@ describe TreeEntryPresenter do
let(:presenter) { described_class.new(tree) } let(:presenter) { described_class.new(tree) }
   
describe '.web_url' do describe '.web_url' do
it { expect(presenter.web_url).to eq("http://localhost/#{project.full_path}/-/tree/#{tree.commit_id}/#{tree.path}") } it { expect(presenter.web_url).to eq("http://localhost/#{project.full_path}/tree/#{tree.commit_id}/#{tree.path}") }
end end
end end
Loading
@@ -852,7 +852,7 @@ describe API::Internal::Base do
Loading
@@ -852,7 +852,7 @@ describe API::Internal::Base do
   
message = <<~MESSAGE.strip message = <<~MESSAGE.strip
To create a merge request for #{branch_name}, visit: To create a merge request for #{branch_name}, visit:
http://#{Gitlab.config.gitlab.host}/#{project.full_path}/-/merge_requests/new?merge_request%5Bsource_branch%5D=#{branch_name} http://#{Gitlab.config.gitlab.host}/#{project.full_path}/merge_requests/new?merge_request%5Bsource_branch%5D=#{branch_name}
MESSAGE MESSAGE
   
expect(json_response['messages']).to include(build_basic_message(message)) expect(json_response['messages']).to include(build_basic_message(message))
Loading
@@ -909,7 +909,7 @@ describe API::Internal::Base do
Loading
@@ -909,7 +909,7 @@ describe API::Internal::Base do
   
message = <<~MESSAGE.strip message = <<~MESSAGE.strip
View merge request for #{branch_name}: View merge request for #{branch_name}:
http://#{Gitlab.config.gitlab.host}/#{project.full_path}/-/merge_requests/1 http://#{Gitlab.config.gitlab.host}/#{project.full_path}/merge_requests/1
MESSAGE MESSAGE
   
expect(json_response['messages']).to include(build_basic_message(message)) expect(json_response['messages']).to include(build_basic_message(message))
Loading
Loading
Loading
@@ -715,7 +715,7 @@ describe API::Projects do
Loading
@@ -715,7 +715,7 @@ describe API::Projects do
   
post api('/projects', user), params: project post api('/projects', user), params: project
   
expect(json_response['readme_url']).to eql("#{Gitlab.config.gitlab.url}/#{json_response['namespace']['full_path']}/somewhere/-/blob/master/README.md") expect(json_response['readme_url']).to eql("#{Gitlab.config.gitlab.url}/#{json_response['namespace']['full_path']}/somewhere/blob/master/README.md")
end end
   
it 'sets tag list to a project' do it 'sets tag list to a project' do
Loading
Loading
Loading
@@ -76,7 +76,7 @@ describe API::Releases do
Loading
@@ -76,7 +76,7 @@ describe API::Releases do
mr_uri = URI.parse(links['merge_requests_url']) mr_uri = URI.parse(links['merge_requests_url'])
issue_uri = URI.parse(links['issues_url']) issue_uri = URI.parse(links['issues_url'])
   
expect(mr_uri.path).to eq("#{path_base}/-/merge_requests") expect(mr_uri.path).to eq("#{path_base}/merge_requests")
expect(issue_uri.path).to eq("#{path_base}/issues") expect(issue_uri.path).to eq("#{path_base}/issues")
expect(mr_uri.query).to eq(expected_query) expect(mr_uri.query).to eq(expected_query)
expect(issue_uri.query).to eq(expected_query) expect(issue_uri.query).to eq(expected_query)
Loading
Loading
Loading
@@ -834,7 +834,7 @@ describe 'Git HTTP requests' do
Loading
@@ -834,7 +834,7 @@ describe 'Git HTTP requests' do
Blob.decorate(Gitlab::Git::Blob.find(project.repository, 'master', 'bar/branch-test.txt'), project) Blob.decorate(Gitlab::Git::Blob.find(project.repository, 'master', 'bar/branch-test.txt'), project)
end end
   
get "/#{project.full_path}/-/blob/master/info/refs" get "/#{project.full_path}/blob/master/info/refs"
end end
   
it "returns the file" do it "returns the file" do
Loading
@@ -844,7 +844,7 @@ describe 'Git HTTP requests' do
Loading
@@ -844,7 +844,7 @@ describe 'Git HTTP requests' do
   
context "when the file does not exist" do context "when the file does not exist" do
before do before do
get "/#{project.full_path}/-/blob/master/info/refs" get "/#{project.full_path}/blob/master/info/refs"
end end
   
it "redirects" do it "redirects" do
Loading
Loading
Loading
@@ -4,7 +4,7 @@ require 'spec_helper'
Loading
@@ -4,7 +4,7 @@ require 'spec_helper'
   
describe 'merge requests discussions' do describe 'merge requests discussions' do
# Further tests can be found at merge_requests_controller_spec.rb # Further tests can be found at merge_requests_controller_spec.rb
describe 'GET /:namespace/:project/-/merge_requests/:iid/discussions' do describe 'GET /:namespace/:project/merge_requests/:iid/discussions' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { project.owner }
let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) } let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) }
Loading
Loading
Loading
@@ -26,8 +26,8 @@ describe 'Update of user activity' do
Loading
@@ -26,8 +26,8 @@ describe 'Update of user activity' do
'/dashboard/todos', '/dashboard/todos',
'/group/project/issues', '/group/project/issues',
'/group/project/issues/10', '/group/project/issues/10',
'/group/project/-/merge_requests', '/group/project/merge_requests',
'/group/project/-/merge_requests/15' '/group/project/merge_requests/15'
] ]
   
context 'without an authenticated user' do context 'without an authenticated user' do
Loading
Loading
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment