Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
87035c29
Commit
87035c29
authored
8 years ago
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't blow up in tree view on empty repo
parent
2556d6d3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+20
-0
No files found.
app/controllers/projects_controller.rb
View file @
87035c29
...
...
@@ -5,7 +5,7 @@ class ProjectsController < Projects::ApplicationController
before_action
:project
,
except:
[
:new
,
:create
]
before_action
:repository
,
except:
[
:new
,
:create
]
before_action
:assign_ref_vars
,
only:
[
:show
],
if: :repo_exists?
before_action
:tree
,
only:
[
:show
],
if:
:project_view_files?
before_action
:tree
,
only:
[
:show
],
if:
[
:repo_exists?
,
:project_view_files?
]
# Authorize
before_action
:authorize_admin_project!
,
only:
[
:edit
,
:update
,
:housekeeping
,
:download_export
,
:export
,
:remove_export
,
:generate_new_export
]
...
...
This diff is collapsed.
Click to expand it.
spec/controllers/projects_controller_spec.rb
View file @
87035c29
...
...
@@ -43,6 +43,26 @@ describe ProjectsController do
end
end
context
"project with empty repo"
do
let
(
:empty_project
)
{
create
(
:project_empty_repo
,
:public
)
}
before
{
sign_in
(
user
)
}
User
.
project_views
.
keys
.
each
do
|
project_view
|
context
"with
#{
project_view
}
view set"
do
before
do
user
.
update_attributes
(
project_view:
project_view
)
get
:show
,
namespace_id:
empty_project
.
namespace
.
path
,
id:
empty_project
.
path
end
it
"renders the empty project view"
do
expect
(
response
).
to
render_template
(
'empty'
)
end
end
end
end
context
"rendering default project view"
do
render_views
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment