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
051aca5e
Commit
051aca5e
authored
Sep 11, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve spec/controllers/groups/analytics_controller_spec.rb failures
parent
526c8111
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
app/controllers/groups/analytics_controller.rb
app/controllers/groups/analytics_controller.rb
+1
-1
spec/controllers/groups/analytics_controller_spec.rb
spec/controllers/groups/analytics_controller_spec.rb
+10
-6
No files found.
app/controllers/groups/analytics_controller.rb
View file @
051aca5e
...
...
@@ -5,7 +5,7 @@ class Groups::AnalyticsController < Groups::ApplicationController
layout
'group'
def
show
@users
=
@group
.
users
.
select
(
:id
,
:name
,
:username
)
@users
=
@group
.
users
.
select
(
:id
,
:name
,
:username
)
.
reorder
(
:id
)
@start_date
=
params
[
:start_date
]
||
Date
.
today
-
1
.
week
@events
=
Event
.
contributions
.
where
(
"created_at > ?"
,
@start_date
)
...
...
spec/controllers/groups/analytics_controller_spec.rb
View file @
051aca5e
...
...
@@ -62,16 +62,20 @@ describe Groups::AnalyticsController do
end
end
it
'sets instance variables properly'
do
it
'sets instance variables properly'
,
:aggregate_failures
do
get
:show
,
group_id:
group
.
path
expect
(
controller
.
instance_variable_get
(
:@users
)).
to
match_array
([
user
,
user2
,
user3
])
expect
(
controller
.
instance_variable_get
(
:@events
).
length
).
to
eq
(
6
)
stats
=
controller
.
instance_variable_get
(
:@stats
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
assigns
[
:users
]).
to
match_array
([
user
,
user2
,
user3
])
expect
(
assigns
[
:events
].
length
).
to
eq
(
6
)
stats
=
assigns
[
:stats
]
# NOTE: The array ordering matters! The view references them all by index
expect
(
stats
[
:total_events
]).
to
eq
([
2
,
2
,
2
])
expect
(
stats
[
:merge_requests_merged
]).
to
eq
([
0
,
0
,
0
])
expect
(
stats
[
:merge_requests_created
]).
to
eq
([
1
,
1
,
0
])
expect
(
stats
[
:issues_closed
]).
to
eq
([
0
,
1
,
1
])
expect
(
stats
[
:merge_requests_created
]).
to
eq
([
0
,
1
,
1
])
expect
(
stats
[
:issues_closed
]).
to
eq
([
1
,
1
,
0
])
expect
(
stats
[
:push
]).
to
eq
([
1
,
0
,
1
])
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