Commit 872dfcc8 authored by Corinna Wiesner's avatar Corinna Wiesner

Fix empty line to contain two values

Prior to this change, the empty line between the license information
header and the user count table only contained a single value. This
prevents to convert the license usage file csv into a hash by using to_h
and instead required a manual mapping.
Now, the empty line contains two empty strings to reflect a valid hash
structure.

Changelog: changed
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/78678
EE: true
parent 9bbcb642
......@@ -39,7 +39,7 @@ module HistoricalUserData
csv << ['License End Date', license.expires_at&.to_s(:csv)]
csv << ['Company', license.licensee_company]
csv << ['Generated At', Time.current.to_s(:csv)]
csv << ['']
csv << ['', '']
end
end
end
......
......@@ -92,6 +92,13 @@ RSpec.describe HistoricalUserData::CsvService do
end
end
context 'Empty Row' do
it 'adds an empty row between the License Information Header and the User Count Table' do
expect(csv[6][0]).to eq('')
expect(csv[6][1]).to eq('')
end
end
context 'User Count Table' do
let_it_be(:historical_datum) do
create(:historical_data, recorded_at: license_start_date, active_user_count: 1)
......
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