Browse Source

Update app/controllers/test_data_controller.rb

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/3031/head
Manny Dinssa 1 month ago committed by GitHub
parent
commit
c09d1780e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      app/controllers/test_data_controller.rb

3
app/controllers/test_data_controller.rb

@ -22,7 +22,8 @@ class TestDataController < ApplicationController
return render_not_found unless FeatureToggle.create_test_logs_enabled? return render_not_found unless FeatureToggle.create_test_logs_enabled?
file = Tempfile.new("#{year}_test_lettings_log.csv") file = Tempfile.new("#{year}_test_lettings_log.csv")
log = FactoryBot.create(:lettings_log, :completed, assigned_to: current_user, ppostcode_full: "SW1A 1AA", startdate: generate_different_date_within_collection_year(Time.zone.now, end_date_override: Time.zone.now + 14.days)) start_date = Time.zone.local(year.to_i, 1, 1)
log = FactoryBot.create(:lettings_log, :completed, assigned_to: current_user, ppostcode_full: "SW1A 1AA", startdate: generate_different_date_within_collection_year(start_date, end_date_override: start_date + 14.days))
log_to_csv = BulkUpload::LettingsLogToCsv.new(log:, line_ending: "\n", overrides: { organisation_id: "ORG#{log.owning_organisation_id}", managing_organisation_id: "ORG#{log.owning_organisation_id}" }) log_to_csv = BulkUpload::LettingsLogToCsv.new(log:, line_ending: "\n", overrides: { organisation_id: "ORG#{log.owning_organisation_id}", managing_organisation_id: "ORG#{log.owning_organisation_id}" })
file.write(log_to_csv.default_field_numbers_row) file.write(log_to_csv.default_field_numbers_row)
file.write(log_to_csv.to_csv_row) file.write(log_to_csv.to_csv_row)

Loading…
Cancel
Save