Skip to content
Snippets Groups Projects
Commit a3331eee authored by James Lopez's avatar James Lopez
Browse files

Updated code based on feedback

parent 7a63021a
No related branches found
No related tags found
No related merge requests found
Loading
@@ -10,7 +10,7 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
Loading
@@ -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
Loading
@@ -68,8 +68,4 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
Loading
@@ -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
Loading
@@ -17,7 +17,7 @@ describe Projects::CycleAnalyticsController do
Loading
@@ -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
   
Loading
@@ -36,7 +36,7 @@ describe Projects::CycleAnalyticsController do
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment