Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controllers/usage_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ def yearly_plans
plan_data(args: default_query_args)
sep = sep_param
send_data(CSV.generate(col_sep: sep) do |csv|
csv << [_('Month'), _('No. Completed Plans')]
csv << [_('Month'), _('No. Created Plans')]
total = 0
@plans_per_month.each do |data|
csv << [data.date.strftime('%b-%y'), data.count]
total += data.count
end
csv << [_('Total'), total]
end, filename: 'completed_plans.csv')
end, filename: 'created_plans.csv')
end
# rubocop:enable Metrics/AbcSize

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/usage_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
get :yearly_plans
end
it 'assigns the correct csv data' do
expected = "Month,No. Completed Plans\n" \
expected = "Month,No. Created Plans\n" \
"#{@date.strftime('%b-%y')},#{@plan_stat.count}\n" \
"Total,#{@plan_stat.count}\n"
expect(response.content_type).to eq('text/csv')
Expand Down