diff --git a/spec/support/bulk_upload/log_to_csv.rb b/spec/support/bulk_upload/log_to_csv.rb index 4bca53358..4ca9ebad3 100644 --- a/spec/support/bulk_upload/log_to_csv.rb +++ b/spec/support/bulk_upload/log_to_csv.rb @@ -157,12 +157,7 @@ class BulkUpload::LogToCsv end def renewal - case log.renewal - when 1 - 1 - when 0 - 2 - end + checkbox_value(log.renewal) end def london_affordable_rent @@ -208,12 +203,7 @@ class BulkUpload::LogToCsv end def previous_postcode_known - case log.ppcodenk - when 1 - 1 - when 0 - 2 - end + checkbox_value(log.ppcodenk) end def homeless @@ -226,25 +216,19 @@ class BulkUpload::LogToCsv end def cbl - case log.cbl - when 0 - 2 - when 1 - 1 - end + checkbox_value(log.cbl) end def chr - case log.chr - when 0 - 2 - when 1 - 1 - end + checkbox_value(log.chr) end def cap - case log.cap + checkbox_value(log.cap) + end + + def checkbox_value(field) + case field when 0 2 when 1