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
a3331eee
Commit
a3331eee
authored
Nov 21, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated code based on feedback
parent
7a63021a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
app/controllers/projects/cycle_analytics_controller.rb
app/controllers/projects/cycle_analytics_controller.rb
+1
-5
spec/controllers/projects/cycle_analytics_controller_spec.rb
spec/controllers/projects/cycle_analytics_controller_spec.rb
+2
-2
No files found.
app/controllers/projects/cycle_analytics_controller.rb
View file @
a3331eee
...
...
@@ -10,7 +10,7 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
stats_values
,
cycle_analytics_json
=
generate_cycle_analytics_data
@cycle_analytics_no
t_set_up
=
stats_with_no_data?
(
stats_values
)
@cycle_analytics_no
_data
=
stats_values
.
blank?
respond_to
do
|
format
|
format
.
html
...
...
@@ -68,8 +68,4 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
[
stats_values
,
cycle_analytics_hash
]
end
def
stats_with_no_data?
(
stats_values
)
stats_values
.
blank?
||
stats_values
.
inject
(:
+
).
zero?
end
end
spec/controllers/projects/cycle_analytics_controller_spec.rb
View file @
a3331eee
...
...
@@ -17,7 +17,7 @@ describe Projects::CycleAnalyticsController do
project_id:
project
.
to_param
)
expect
(
response
).
to
be_success
expect
(
assigns
(
:cycle_analytics_no
t_set_up
)).
to
eq
(
true
)
expect
(
assigns
(
:cycle_analytics_no
_data
)).
to
eq
(
true
)
end
end
...
...
@@ -36,7 +36,7 @@ describe Projects::CycleAnalyticsController do
project_id:
project
.
to_param
)
expect
(
response
).
to
be_success
expect
(
assigns
(
:cycle_analytics_no
t_set_up
)).
to
eq
(
false
)
expect
(
assigns
(
:cycle_analytics_no
_data
)).
to
eq
(
false
)
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