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

Add latest changes from gitlab-org/gitlab@master

parent c8e28a0b
No related branches found
No related tags found
No related merge requests found
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
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
@@ -812,7 +812,7 @@ describe API::Projects do
Loading
@@ -812,7 +812,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
@@ -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
@@ -273,16 +273,16 @@ describe 'project routing' do
Loading
@@ -273,16 +273,16 @@ describe 'project routing' do
end end
   
it 'to #logs_tree' do it 'to #logs_tree' do
expect(get('/gitlab/gitlabhq/refs/stable/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'stable') expect(get('/gitlab/gitlabhq/-/refs/stable/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'stable')
expect(get('/gitlab/gitlabhq/refs/feature%2345/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature#45') expect(get('/gitlab/gitlabhq/-/refs/feature%2345/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature#45')
expect(get('/gitlab/gitlabhq/refs/feature%2B45/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45') expect(get('/gitlab/gitlabhq/-/refs/feature%2B45/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45')
expect(get('/gitlab/gitlabhq/refs/feature@45/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45') expect(get('/gitlab/gitlabhq/-/refs/feature@45/logs_tree')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45')
expect(get('/gitlab/gitlabhq/refs/stable/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz') expect(get('/gitlab/gitlabhq/-/refs/stable/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz')
expect(get('/gitlab/gitlabhq/refs/feature%2345/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature#45', path: 'foo/bar/baz') expect(get('/gitlab/gitlabhq/-/refs/feature%2345/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature#45', path: 'foo/bar/baz')
expect(get('/gitlab/gitlabhq/refs/feature%2B45/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45', path: 'foo/bar/baz') expect(get('/gitlab/gitlabhq/-/refs/feature%2B45/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature+45', path: 'foo/bar/baz')
expect(get('/gitlab/gitlabhq/refs/feature@45/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45', path: 'foo/bar/baz') expect(get('/gitlab/gitlabhq/-/refs/feature@45/logs_tree/foo/bar/baz')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature@45', path: 'foo/bar/baz')
expect(get('/gitlab/gitlabhq/refs/stable/logs_tree/files.scss')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'stable', path: 'files.scss') expect(get('/gitlab/gitlabhq/-/refs/stable/logs_tree/files.scss')).to route_to('projects/refs#logs_tree', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'stable', path: 'files.scss')
assert_routing({ path: "/gitlab/gitlabhq/refs/stable/logs_tree/new%0A%0Aline.txt", assert_routing({ path: "/gitlab/gitlabhq/-/refs/stable/logs_tree/new%0A%0Aline.txt",
method: :get }, method: :get },
{ controller: 'projects/refs', action: 'logs_tree', { controller: 'projects/refs', action: 'logs_tree',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
Loading
@@ -460,9 +460,14 @@ describe 'project routing' do
Loading
@@ -460,9 +460,14 @@ describe 'project routing' do
it_behaves_like 'RESTful project resources' do it_behaves_like 'RESTful project resources' do
let(:actions) { [:show] } let(:actions) { [:show] }
let(:controller) { 'commits' } let(:controller) { 'commits' }
let(:controller_path) { '/-/commits' }
end end
   
it 'to #show' do it 'to #show' do
expect(get('/gitlab/gitlabhq/-/commits/master.atom')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master.atom')
end
it 'to #show unscoped routing' do
expect(get('/gitlab/gitlabhq/commits/master.atom')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master.atom') expect(get('/gitlab/gitlabhq/commits/master.atom')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master.atom')
end end
end end
Loading
@@ -556,11 +561,11 @@ describe 'project routing' do
Loading
@@ -556,11 +561,11 @@ describe 'project routing' do
# project_blame GET /:project_id/blame/:id(.:format) blame#show {id: /[^\0]+/, project_id: /[^\/]+/} # project_blame GET /:project_id/blame/:id(.:format) blame#show {id: /[^\0]+/, project_id: /[^\/]+/}
describe Projects::BlameController, 'routing' do describe Projects::BlameController, 'routing' do
it 'to #show' do it 'to #show' do
expect(get('/gitlab/gitlabhq/blame/master/app/models/project.rb')).to route_to('projects/blame#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb') expect(get('/gitlab/gitlabhq/-/blame/master/app/models/project.rb')).to route_to('projects/blame#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
expect(get('/gitlab/gitlabhq/blame/master/files.scss')).to route_to('projects/blame#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss') expect(get('/gitlab/gitlabhq/-/blame/master/files.scss')).to route_to('projects/blame#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss')
newline_file = "new\n\nline.txt" newline_file = "new\n\nline.txt"
url_encoded_newline_file = ERB::Util.url_encode(newline_file) url_encoded_newline_file = ERB::Util.url_encode(newline_file)
assert_routing({ path: "/gitlab/gitlabhq/blame/master/#{url_encoded_newline_file}", assert_routing({ path: "/gitlab/gitlabhq/-/blame/master/#{url_encoded_newline_file}",
method: :get }, method: :get },
{ controller: 'projects/blame', action: 'show', { controller: 'projects/blame', action: 'show',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
Loading
@@ -571,44 +576,44 @@ describe 'project routing' do
Loading
@@ -571,44 +576,44 @@ describe 'project routing' do
# project_blob GET /:project_id/blob/:id(.:format) blob#show {id: /[^\0]+/, project_id: /[^\/]+/} # project_blob GET /:project_id/blob/:id(.:format) blob#show {id: /[^\0]+/, project_id: /[^\/]+/}
describe Projects::BlobController, 'routing' do describe Projects::BlobController, 'routing' do
it 'to #show' do it 'to #show' do
expect(get('/gitlab/gitlabhq/blob/master/app/models/project.rb')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb') expect(get('/gitlab/gitlabhq/-/blob/master/app/models/project.rb')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
expect(get('/gitlab/gitlabhq/blob/master/app/models/compare.rb')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/compare.rb') expect(get('/gitlab/gitlabhq/-/blob/master/app/models/compare.rb')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/compare.rb')
expect(get('/gitlab/gitlabhq/blob/master/app/models/diff.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/diff.js') expect(get('/gitlab/gitlabhq/-/blob/master/app/models/diff.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/diff.js')
expect(get('/gitlab/gitlabhq/blob/master/files.scss')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss') expect(get('/gitlab/gitlabhq/-/blob/master/files.scss')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss')
expect(get('/gitlab/gitlabhq/blob/master/blob/index.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/blob/index.js') expect(get('/gitlab/gitlabhq/-/blob/master/blob/index.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/blob/index.js')
expect(get('/gitlab/gitlabhq/blob/blob/master/blob/index.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'blob/master/blob/index.js') expect(get('/gitlab/gitlabhq/-/blob/blob/master/blob/index.js')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'blob/master/blob/index.js')
newline_file = "new\n\nline.txt" newline_file = "new\n\nline.txt"
url_encoded_newline_file = ERB::Util.url_encode(newline_file) url_encoded_newline_file = ERB::Util.url_encode(newline_file)
assert_routing({ path: "/gitlab/gitlabhq/blob/blob/master/blob/#{url_encoded_newline_file}", assert_routing({ path: "/gitlab/gitlabhq/-/blob/blob/master/blob/#{url_encoded_newline_file}",
method: :get }, method: :get },
{ controller: 'projects/blob', action: 'show', { controller: 'projects/blob', action: 'show',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
id: "blob/master/blob/#{newline_file}" }) id: "blob/master/blob/#{newline_file}" })
end end
   
it 'to #show from scope routing' do it 'to #show from unscoped routing' do
expect(get('/gitlab/gitlabhq/-/blob/master/app/models/project.rb')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb') expect(get('/gitlab/gitlabhq/blob/master/app/models/project.rb')).to route_to('projects/blob#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
end end
end end
   
# project_tree GET /:project_id/tree/:id(.:format) tree#show {id: /[^\0]+/, project_id: /[^\/]+/} # project_tree GET /:project_id/tree/:id(.:format) tree#show {id: /[^\0]+/, project_id: /[^\/]+/}
describe Projects::TreeController, 'routing' do describe Projects::TreeController, 'routing' do
it 'to #show' do it 'to #show' do
expect(get('/gitlab/gitlabhq/tree/master/app/models/project.rb')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb') expect(get('/gitlab/gitlabhq/-/tree/master/app/models/project.rb')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
expect(get('/gitlab/gitlabhq/tree/master/files.scss')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss') expect(get('/gitlab/gitlabhq/-/tree/master/files.scss')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/files.scss')
expect(get('/gitlab/gitlabhq/tree/master/tree/files')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/tree/files') expect(get('/gitlab/gitlabhq/-/tree/master/tree/files')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/tree/files')
expect(get('/gitlab/gitlabhq/tree/tree/master/tree/files')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'tree/master/tree/files') expect(get('/gitlab/gitlabhq/-/tree/tree/master/tree/files')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'tree/master/tree/files')
newline_file = "new\n\nline.txt" newline_file = "new\n\nline.txt"
url_encoded_newline_file = ERB::Util.url_encode(newline_file) url_encoded_newline_file = ERB::Util.url_encode(newline_file)
assert_routing({ path: "/gitlab/gitlabhq/tree/master/#{url_encoded_newline_file}", assert_routing({ path: "/gitlab/gitlabhq/-/tree/master/#{url_encoded_newline_file}",
method: :get }, method: :get },
{ controller: 'projects/tree', action: 'show', { controller: 'projects/tree', action: 'show',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
id: "master/#{newline_file}" }) id: "master/#{newline_file}" })
end end
   
it 'to #show from scope routing' do it 'to #show from unscoped routing' do
expect(get('/gitlab/gitlabhq/-/tree/master/app/models/project.rb')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb') expect(get('/gitlab/gitlabhq/tree/master/app/models/project.rb')).to route_to('projects/tree#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
end end
end end
   
Loading
@@ -616,10 +621,10 @@ describe 'project routing' do
Loading
@@ -616,10 +621,10 @@ describe 'project routing' do
# project_files GET /:namespace_id/:project_id/files/*id(.:format) projects/find_file#list {:id=>/(?:[^.]|\.(?!json$))+/, :namespace_id=>/[a-zA-Z.0-9_\-]+/, :project_id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/, :format=>/json/} # project_files GET /:namespace_id/:project_id/files/*id(.:format) projects/find_file#list {:id=>/(?:[^.]|\.(?!json$))+/, :namespace_id=>/[a-zA-Z.0-9_\-]+/, :project_id=>/[a-zA-Z.0-9_\-]+(?<!\.atom)/, :format=>/json/}
describe Projects::FindFileController, 'routing' do describe Projects::FindFileController, 'routing' do
it 'to #show' do it 'to #show' do
expect(get('/gitlab/gitlabhq/find_file/master')).to route_to('projects/find_file#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master') expect(get('/gitlab/gitlabhq/-/find_file/master')).to route_to('projects/find_file#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master')
newline_file = "new\n\nline.txt" newline_file = "new\n\nline.txt"
url_encoded_newline_file = ERB::Util.url_encode(newline_file) url_encoded_newline_file = ERB::Util.url_encode(newline_file)
assert_routing({ path: "/gitlab/gitlabhq/find_file/#{url_encoded_newline_file}", assert_routing({ path: "/gitlab/gitlabhq/-/find_file/#{url_encoded_newline_file}",
method: :get }, method: :get },
{ controller: 'projects/find_file', action: 'show', { controller: 'projects/find_file', action: 'show',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
Loading
@@ -627,10 +632,10 @@ describe 'project routing' do
Loading
@@ -627,10 +632,10 @@ describe 'project routing' do
end end
   
it 'to #list' do it 'to #list' do
expect(get('/gitlab/gitlabhq/files/master.json')).to route_to('projects/find_file#list', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master.json') expect(get('/gitlab/gitlabhq/-/files/master.json')).to route_to('projects/find_file#list', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master.json')
newline_file = "new\n\nline.txt" newline_file = "new\n\nline.txt"
url_encoded_newline_file = ERB::Util.url_encode(newline_file) url_encoded_newline_file = ERB::Util.url_encode(newline_file)
assert_routing({ path: "/gitlab/gitlabhq/files/#{url_encoded_newline_file}", assert_routing({ path: "/gitlab/gitlabhq/-/files/#{url_encoded_newline_file}",
method: :get }, method: :get },
{ controller: 'projects/find_file', action: 'list', { controller: 'projects/find_file', action: 'list',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
Loading
@@ -640,13 +645,13 @@ describe 'project routing' do
Loading
@@ -640,13 +645,13 @@ describe 'project routing' do
   
describe Projects::BlobController, 'routing' do describe Projects::BlobController, 'routing' do
it 'to #edit' do it 'to #edit' do
expect(get('/gitlab/gitlabhq/edit/master/app/models/project.rb')).to( expect(get('/gitlab/gitlabhq/-/edit/master/app/models/project.rb')).to(
route_to('projects/blob#edit', route_to('projects/blob#edit',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
id: 'master/app/models/project.rb')) id: 'master/app/models/project.rb'))
newline_file = "new\n\nline.txt" newline_file = "new\n\nline.txt"
url_encoded_newline_file = ERB::Util.url_encode(newline_file) url_encoded_newline_file = ERB::Util.url_encode(newline_file)
assert_routing({ path: "/gitlab/gitlabhq/edit/master/docs/#{url_encoded_newline_file}", assert_routing({ path: "/gitlab/gitlabhq/-/edit/master/docs/#{url_encoded_newline_file}",
method: :get }, method: :get },
{ controller: 'projects/blob', action: 'edit', { controller: 'projects/blob', action: 'edit',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
Loading
@@ -654,13 +659,13 @@ describe 'project routing' do
Loading
@@ -654,13 +659,13 @@ describe 'project routing' do
end end
   
it 'to #preview' do it 'to #preview' do
expect(post('/gitlab/gitlabhq/preview/master/app/models/project.rb')).to( expect(post('/gitlab/gitlabhq/-/preview/master/app/models/project.rb')).to(
route_to('projects/blob#preview', route_to('projects/blob#preview',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
id: 'master/app/models/project.rb')) id: 'master/app/models/project.rb'))
newline_file = "new\n\nline.txt" newline_file = "new\n\nline.txt"
url_encoded_newline_file = ERB::Util.url_encode(newline_file) url_encoded_newline_file = ERB::Util.url_encode(newline_file)
assert_routing({ path: "/gitlab/gitlabhq/edit/master/docs/#{url_encoded_newline_file}", assert_routing({ path: "/gitlab/gitlabhq/-/edit/master/docs/#{url_encoded_newline_file}",
method: :get }, method: :get },
{ controller: 'projects/blob', action: 'edit', { controller: 'projects/blob', action: 'edit',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
Loading
@@ -673,12 +678,16 @@ describe 'project routing' do
Loading
@@ -673,12 +678,16 @@ describe 'project routing' do
it 'to #show' do it 'to #show' do
newline_file = "new\n\nline.txt" newline_file = "new\n\nline.txt"
url_encoded_newline_file = ERB::Util.url_encode(newline_file) url_encoded_newline_file = ERB::Util.url_encode(newline_file)
assert_routing({ path: "/gitlab/gitlabhq/raw/master/#{url_encoded_newline_file}", assert_routing({ path: "/gitlab/gitlabhq/-/raw/master/#{url_encoded_newline_file}",
method: :get }, method: :get },
{ controller: 'projects/raw', action: 'show', { controller: 'projects/raw', action: 'show',
namespace_id: 'gitlab', project_id: 'gitlabhq', namespace_id: 'gitlab', project_id: 'gitlabhq',
id: "master/#{newline_file}" }) id: "master/#{newline_file}" })
end end
it 'to #show from unscoped routing' do
expect(get('/gitlab/gitlabhq/raw/master/app/models/project.rb')).to route_to('projects/raw#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
end
end end
   
# project_compare_index GET /:project_id/compare(.:format) compare#index {id: /[^\/]+/, project_id: /[^\/]+/} # project_compare_index GET /:project_id/compare(.:format) compare#index {id: /[^\/]+/, project_id: /[^\/]+/}
Loading
Loading
Loading
@@ -23,7 +23,7 @@ describe BlobEntity do
Loading
@@ -23,7 +23,7 @@ describe BlobEntity do
mode: "100644", mode: "100644",
readable_text: true, readable_text: true,
icon: "file-text-o", icon: "file-text-o",
url: "/#{project.full_path}/blob/master/bar/branch-test.txt" url: "/#{project.full_path}/-/blob/master/bar/branch-test.txt"
}) })
end end
end end
Loading
Loading
Loading
@@ -60,7 +60,7 @@ describe MergeRequestPollWidgetEntity do
Loading
@@ -60,7 +60,7 @@ describe MergeRequestPollWidgetEntity do
project.add_developer(user) project.add_developer(user)
   
expect(subject[:new_blob_path]) expect(subject[:new_blob_path])
.to eq("/#{resource.project.full_path}/new/#{resource.source_branch}") .to eq("/#{resource.project.full_path}/-/new/#{resource.source_branch}")
end end
end end
   
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe Ci::CreatePipelineService do
context '.pre/.post stages' do
let_it_be(:user) { create(:admin) }
let_it_be(:project) { create(:project, :repository, creator: user) }
let(:source) { :push }
let(:service) { described_class.new(project, user, { ref: ref }) }
let(:pipeline) { service.execute(source) }
let(:config) do
<<~YAML
validate:
stage: .pre
script: echo Hello World
build:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == "master"
script: echo Hello World
notify:
stage: .post
script: echo Hello World
YAML
end
before do
stub_ci_pipeline_yaml_file(config)
end
context 'when pipeline contains a build except .pre/.post' do
let(:ref) { 'refs/heads/master' }
it 'creates a pipeline' do
expect(pipeline).to be_persisted
expect(pipeline.stages.map(&:name)).to contain_exactly(
*%w(.pre build .post))
expect(pipeline.builds.map(&:name)).to contain_exactly(
*%w(validate build notify))
end
end
context 'when pipeline does not contain any other build except .pre/.post' do
let(:ref) { 'refs/heads/feature' }
it 'does not create a pipeline' do
expect(pipeline).not_to be_persisted
# we can validate a list of stages, as they are assigned
# but not persisted
expect(pipeline.stages.map(&:name)).to contain_exactly(
*%w(.pre .post))
end
end
end
end
Loading
@@ -253,7 +253,7 @@ describe ::SystemNotes::MergeRequestsService do
Loading
@@ -253,7 +253,7 @@ describe ::SystemNotes::MergeRequestsService do
end end
   
it "posts the 'picked merge request' system note" do it "posts the 'picked merge request' system note" do
expect(subject.note).to eq("picked this merge request into branch [`#{branch_name}`](/#{project.full_path}/tree/#{branch_name}) with commit #{commit_sha}") expect(subject.note).to eq("picked this merge request into branch [`#{branch_name}`](/#{project.full_path}/-/tree/#{branch_name}) with commit #{commit_sha}")
end end
   
it 'links the merge request and the cherry-pick commit' do it 'links the merge request and the cherry-pick commit' do
Loading
Loading
Loading
@@ -40,7 +40,7 @@ describe 'help/index' do
Loading
@@ -40,7 +40,7 @@ describe 'help/index' do
render render
   
expect(rendered).to match '8.0.2' expect(rendered).to match '8.0.2'
expect(rendered).to have_link('abcdefg', href: %r{https://gitlab.com/gitlab-org/(gitlab|gitlab-foss)/commits/abcdefg}) expect(rendered).to have_link('abcdefg', href: %r{https://gitlab.com/gitlab-org/(gitlab|gitlab-foss)/-/commits/abcdefg})
end end
end end
end end
Loading
Loading
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