Fix broken project_url
routing when protected branches are accessed with an empty repo
This commit is contained in:
parent
4e5bc1d535
commit
4bc5c66fe1
2 changed files with 26 additions and 0 deletions
|
@ -28,4 +28,20 @@ module GitlabRoutingHelper
|
|||
def merge_request_path(entity, *args)
|
||||
namespace_project_merge_request_path(entity.project.namespace, entity.project, entity, *args)
|
||||
end
|
||||
|
||||
def project_url(project, *args)
|
||||
namespace_project_url(project.namespace, project, *args)
|
||||
end
|
||||
|
||||
def edit_project_url(project, *args)
|
||||
edit_namespace_project_url(project.namespace, project, *args)
|
||||
end
|
||||
|
||||
def issue_url(entity, *args)
|
||||
namespace_project_issue_url(entity.project.namespace, entity.project, entity, *args)
|
||||
end
|
||||
|
||||
def merge_request_url(entity, *args)
|
||||
namespace_project_merge_request_url(entity.project.namespace, entity.project, entity, *args)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
require('spec_helper')
|
||||
|
||||
describe Projects::ProtectedBranchesController do
|
||||
describe "GET #index" do
|
||||
let(:project) { create(:project_empty_repo, :public) }
|
||||
it "redirect empty repo to projects page" do
|
||||
get(:index, namespace_id: project.namespace.to_param, project_id: project.to_param)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue