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
Jérome Perrin
gitlab-ce
Commits
303e9eb5
Commit
303e9eb5
authored
Feb 22, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include contributions from forked projects on profile calendar
parent
5803a530
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
CHANGELOG
CHANGELOG
+1
-0
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+1
-1
spec/controllers/users_controller_spec.rb
spec/controllers/users_controller_spec.rb
+18
-0
No files found.
CHANGELOG
View file @
303e9eb5
Please view this file on the master branch, on stable branches it's out of date.
Please view this file on the master branch, on stable branches it's out of date.
v 8.6.0 (unreleased)
v 8.6.0 (unreleased)
- Contributions to forked projects are included in calendar
v 8.5.0
v 8.5.0
- Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu)
- Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu)
...
...
app/controllers/users_controller.rb
View file @
303e9eb5
...
@@ -57,7 +57,7 @@ class UsersController < ApplicationController
...
@@ -57,7 +57,7 @@ class UsersController < ApplicationController
def
contributions_calendar
def
contributions_calendar
@contributions_calendar
||=
Gitlab
::
ContributionsCalendar
.
@contributions_calendar
||=
Gitlab
::
ContributionsCalendar
.
new
(
contributed_projects
.
reject
(
&
:forked?
)
,
@user
)
new
(
contributed_projects
,
@user
)
end
end
def
load_events
def
load_events
...
...
spec/controllers/users_controller_spec.rb
View file @
303e9eb5
...
@@ -41,6 +41,7 @@ describe UsersController do
...
@@ -41,6 +41,7 @@ describe UsersController do
end
end
describe
'GET #calendar'
do
describe
'GET #calendar'
do
it
'renders calendar'
do
it
'renders calendar'
do
sign_in
(
user
)
sign_in
(
user
)
...
@@ -48,6 +49,23 @@ describe UsersController do
...
@@ -48,6 +49,23 @@ describe UsersController do
expect
(
response
).
to
render_template
(
'calendar'
)
expect
(
response
).
to
render_template
(
'calendar'
)
end
end
context
'forked project'
do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:forked_project
)
{
Projects
::
ForkService
.
new
(
project
,
user
).
execute
}
before
do
sign_in
(
user
)
project
.
team
<<
[
user
,
:developer
]
EventCreateService
.
new
.
push
(
project
,
user
,
[])
EventCreateService
.
new
.
push
(
forked_project
,
user
,
[])
end
it
'includes forked projects'
do
get
:calendar
,
username:
user
.
username
expect
(
assigns
(
:contributions_calendar
).
projects
.
count
).
to
eq
(
2
)
end
end
end
end
describe
'GET #calendar_activities'
do
describe
'GET #calendar_activities'
do
...
...
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