Browse Source

refactor with extract method

pull/1223/head
Phil Lee 3 years ago
parent
commit
cccdeecc53
  1. 34
      spec/support/bulk_upload/log_to_csv.rb

34
spec/support/bulk_upload/log_to_csv.rb

@ -159,12 +159,7 @@ class BulkUpload::LogToCsv
end end
def renewal def renewal
case log.renewal checkbox_value(log.renewal)
when 1
1
when 0
2
end
end end
def london_affordable_rent def london_affordable_rent
@ -210,12 +205,7 @@ class BulkUpload::LogToCsv
end end
def previous_postcode_known def previous_postcode_known
case log.ppcodenk checkbox_value(log.ppcodenk)
when 1
1
when 0
2
end
end end
def homeless def homeless
@ -228,25 +218,19 @@ class BulkUpload::LogToCsv
end end
def cbl def cbl
case log.cbl checkbox_value(log.cbl)
when 0
2
when 1
1
end
end end
def chr def chr
case log.chr checkbox_value(log.chr)
when 0
2
when 1
1
end
end end
def cap def cap
case log.cap checkbox_value(log.cap)
end
def checkbox_value(field)
case field
when 0 when 0
2 2
when 1 when 1

Loading…
Cancel
Save