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
Boxiang Sun
gitlab-ce
Commits
20a12438
Commit
20a12438
authored
Mar 22, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix user controller specs
parent
9c6086bc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
17 deletions
+4
-17
spec/controllers/users_controller_spec.rb
spec/controllers/users_controller_spec.rb
+4
-17
No files found.
spec/controllers/users_controller_spec.rb
View file @
20a12438
...
@@ -25,34 +25,21 @@ describe UsersController do
...
@@ -25,34 +25,21 @@ describe UsersController do
end
end
describe
'GET #calendar_activities'
do
describe
'GET #calendar_activities'
do
include
RepoHelpers
let!
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
)
}
let
(
:calendar_user
)
{
create
(
:user
,
email:
sample_commit
.
author_email
)
}
let
(
:commit1
)
{
'0ed8c6c6752e8c6ea63e7b92a517bf5ac1209c80'
}
let
(
:commit2
)
{
'7d3b0f7cff5f37573aea97cebfd5692ea1689924'
}
before
do
before
do
allow_any_instance_of
(
User
).
to
receive
(
:contributed_projects_ids
).
and_return
([
project
.
id
])
allow_any_instance_of
(
User
).
to
receive
(
:contributed_projects_ids
).
and_return
([
project
.
id
])
project
.
team
<<
[
user
,
:developer
]
project
.
team
<<
[
user
,
:developer
]
end
end
it
'assigns @commit_count'
do
get
:calendar_activities
,
username:
calendar_user
.
username
,
date:
'2014-07-31'
expect
(
assigns
(
:commit_count
)).
to
eq
(
2
)
end
it
'assigns @calendar_date'
do
it
'assigns @calendar_date'
do
get
:calendar_activities
,
username:
calendar_
user
.
username
,
date:
'2014-07-31'
get
:calendar_activities
,
username:
user
.
username
,
date:
'2014-07-31'
expect
(
assigns
(
:calendar_date
)).
to
eq
(
Date
.
parse
(
'2014-07-31'
))
expect
(
assigns
(
:calendar_date
)).
to
eq
(
Date
.
parse
(
'2014-07-31'
))
end
end
it
'assigns @calendar_activities'
do
get
:calendar_activities
,
username:
calendar_user
.
username
,
date:
'2014-07-31'
expect
(
assigns
(
:calendar_activities
).
values
.
flatten
.
map
(
&
:id
)).
to
eq
([
commit1
,
commit2
])
end
it
'renders calendar_activities'
do
it
'renders calendar_activities'
do
get
:calendar_activities
,
username:
calendar_
user
.
username
get
:calendar_activities
,
username:
user
.
username
expect
(
response
).
to
render_template
(
'calendar_activities'
)
expect
(
response
).
to
render_template
(
'calendar_activities'
)
end
end
end
end
...
...
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