Commit a3331eee authored by James Lopez's avatar James Lopez

Updated code based on feedback

parent 7a63021a
...@@ -10,7 +10,7 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController ...@@ -10,7 +10,7 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
stats_values, cycle_analytics_json = generate_cycle_analytics_data stats_values, cycle_analytics_json = generate_cycle_analytics_data
@cycle_analytics_not_set_up = stats_with_no_data?(stats_values) @cycle_analytics_no_data = stats_values.blank?
respond_to do |format| respond_to do |format|
format.html format.html
...@@ -68,8 +68,4 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController ...@@ -68,8 +68,4 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
[stats_values, cycle_analytics_hash] [stats_values, cycle_analytics_hash]
end end
def stats_with_no_data?(stats_values)
stats_values.blank? || stats_values.inject(:+).zero?
end
end end
...@@ -17,7 +17,7 @@ describe Projects::CycleAnalyticsController do ...@@ -17,7 +17,7 @@ describe Projects::CycleAnalyticsController do
project_id: project.to_param) project_id: project.to_param)
expect(response).to be_success expect(response).to be_success
expect(assigns(:cycle_analytics_not_set_up)).to eq(true) expect(assigns(:cycle_analytics_no_data)).to eq(true)
end end
end end
...@@ -36,7 +36,7 @@ describe Projects::CycleAnalyticsController do ...@@ -36,7 +36,7 @@ describe Projects::CycleAnalyticsController do
project_id: project.to_param) project_id: project.to_param)
expect(response).to be_success expect(response).to be_success
expect(assigns(:cycle_analytics_not_set_up)).to eq(false) expect(assigns(:cycle_analytics_no_data)).to eq(false)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment