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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5b835145
Commit
5b835145
authored
Mar 19, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
c6cf7647
3c5a81cb
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
6 deletions
+77
-6
app/controllers/admin/projects_controller.rb
app/controllers/admin/projects_controller.rb
+1
-1
app/controllers/dashboard/projects_controller.rb
app/controllers/dashboard/projects_controller.rb
+2
-2
app/controllers/explore/projects_controller.rb
app/controllers/explore/projects_controller.rb
+3
-3
changelogs/unreleased/fix-projects-partial-locals.yml
changelogs/unreleased/fix-projects-partial-locals.yml
+5
-0
spec/controllers/admin/projects_controller_spec.rb
spec/controllers/admin/projects_controller_spec.rb
+10
-0
spec/controllers/dashboard/projects_controller_spec.rb
spec/controllers/dashboard/projects_controller_spec.rb
+26
-0
spec/controllers/explore/projects_controller_spec.rb
spec/controllers/explore/projects_controller_spec.rb
+30
-0
No files found.
app/controllers/admin/projects_controller.rb
View file @
5b835145
...
...
@@ -15,7 +15,7 @@ class Admin::ProjectsController < Admin::ApplicationController
format
.
html
format
.
json
do
render
json:
{
html:
view_to_html_string
(
"admin/projects/_projects"
,
locals:
{
projects:
@projects
}
)
html:
view_to_html_string
(
"admin/projects/_projects"
,
projects:
@projects
)
}
end
end
...
...
app/controllers/dashboard/projects_controller.rb
View file @
5b835145
...
...
@@ -26,7 +26,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
end
format
.
json
do
render
json:
{
html:
view_to_html_string
(
"dashboard/projects/_projects"
,
locals:
{
projects:
@projects
}
)
html:
view_to_html_string
(
"dashboard/projects/_projects"
,
projects:
@projects
)
}
end
end
...
...
@@ -43,7 +43,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
format
.
html
format
.
json
do
render
json:
{
html:
view_to_html_string
(
"dashboard/projects/_projects"
,
locals:
{
projects:
@projects
}
)
html:
view_to_html_string
(
"dashboard/projects/_projects"
,
projects:
@projects
)
}
end
end
...
...
app/controllers/explore/projects_controller.rb
View file @
5b835145
...
...
@@ -15,7 +15,7 @@ class Explore::ProjectsController < Explore::ApplicationController
format
.
html
format
.
json
do
render
json:
{
html:
view_to_html_string
(
"explore/projects/_projects"
,
locals:
{
projects:
@projects
}
)
html:
view_to_html_string
(
"explore/projects/_projects"
,
projects:
@projects
)
}
end
end
...
...
@@ -30,7 +30,7 @@ class Explore::ProjectsController < Explore::ApplicationController
format
.
html
format
.
json
do
render
json:
{
html:
view_to_html_string
(
"explore/projects/_projects"
,
locals:
{
projects:
@projects
}
)
html:
view_to_html_string
(
"explore/projects/_projects"
,
projects:
@projects
)
}
end
end
...
...
@@ -44,7 +44,7 @@ class Explore::ProjectsController < Explore::ApplicationController
format
.
html
format
.
json
do
render
json:
{
html:
view_to_html_string
(
"explore/projects/_projects"
,
locals:
{
projects:
@projects
}
)
html:
view_to_html_string
(
"explore/projects/_projects"
,
projects:
@projects
)
}
end
end
...
...
changelogs/unreleased/fix-projects-partial-locals.yml
0 → 100644
View file @
5b835145
---
title
:
Fix undefined variable error on json project views
merge_request
:
26297
author
:
type
:
fixed
spec/controllers/admin/projects_controller_spec.rb
View file @
5b835145
...
...
@@ -43,6 +43,16 @@ describe Admin::ProjectsController do
end
end
describe
'GET /projects.json'
do
render_views
before
do
get
:index
,
format: :json
end
it
{
is_expected
.
to
respond_with
(
:success
)
}
end
describe
'GET /projects/:id'
do
render_views
...
...
spec/controllers/dashboard/projects_controller_spec.rb
View file @
5b835145
...
...
@@ -2,4 +2,30 @@ require 'spec_helper'
describe
Dashboard
::
ProjectsController
do
it_behaves_like
'authenticates sessionless user'
,
:index
,
:atom
context
'json requests'
do
render_views
let
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
end
describe
'GET /projects.json'
do
before
do
get
:index
,
format: :json
end
it
{
is_expected
.
to
respond_with
(
:success
)
}
end
describe
'GET /starred.json'
do
before
do
get
:starred
,
format: :json
end
it
{
is_expected
.
to
respond_with
(
:success
)
}
end
end
end
spec/controllers/explore/projects_controller_spec.rb
View file @
5b835145
require
'spec_helper'
describe
Explore
::
ProjectsController
do
describe
'GET #index.json'
do
render_views
before
do
get
:index
,
format: :json
end
it
{
is_expected
.
to
respond_with
(
:success
)
}
end
describe
'GET #trending.json'
do
render_views
before
do
get
:trending
,
format: :json
end
it
{
is_expected
.
to
respond_with
(
:success
)
}
end
describe
'GET #starred.json'
do
render_views
before
do
get
:starred
,
format: :json
end
it
{
is_expected
.
to
respond_with
(
:success
)
}
end
describe
'GET #trending'
do
context
'sorting by update date'
do
let
(
:project1
)
{
create
(
:project
,
:public
,
updated_at:
3
.
days
.
ago
)
}
...
...
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