chore: correct parsing for 'not sped' and 'lep not first year'

rpp-main
Nelson Jovel 1 year ago
parent c48b944280
commit ee41751f4e

@ -9,7 +9,7 @@ class Ell < ApplicationRecord
ell = ell.delete(",")
case ell
in /lep\s*student\s*1st\s*year|LEP\s*student\s*not\s*1st\s*year|EL\s*Student\s*First\s*Year|LEP\s*student|^EL\s+|true|1|^ELL$/i
in /lep\s*student\s*1st\s*year|LEP\s*student\s*not\s*1st\s*year|EL\s*Student\s*First\s*Year|LEP\s*student|^EL\s+|true|1|^ELL$|^LEP\s*Not\s*1st\s*Year/i
"ELL"
in /0|2|3|Does\s*not\s*apply/i
"Not ELL"

@ -10,9 +10,9 @@ class Sped < ApplicationRecord
case sped
in /active|^A$|1|^Special\s*Education$/i
"Special Education"
in /^I$|exited|0|^Not\s*Special\s*Education$|Does\s*not\s*apply|Referred|Ineligible|^No\s*special\s*needs$/i
in /^I$|exited|0|^Not\s*Special\s*Education$|Does\s*not\s*apply|Referred|Ineligible|^No\s*special\s*needs$|Not\s*SPED/i
"Not Special Education"
in %r{^#*N/*A$|Unknown|SpecialEdStatus|SPED}i
in %r{^#*N/*A$|^Unknown|^SpecialEdStatus|^SPED}i
"Unknown"
else
puts "************************************"

@ -59,7 +59,6 @@ class Subcategory < ActiveRecord::Base
teacher_response_rate: teacher.rate, meets_student_threshold: student.meets_student_threshold?,
meets_teacher_threshold: teacher.meets_teacher_threshold?)
end
@response_rate[[school, academic_year]]
end

@ -579,6 +579,10 @@ RSpec.describe SurveyItemValues, type: :model do
row = { "Raw ELL" => "EL - Early Child. or PK" }
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:)
expect(values.ell).to eq "ELL"
row = { "Raw ELL" => "LEP Not 1st Year" }
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:)
expect(values.ell).to eq "ELL"
end
it 'translates "Does not Apply" into "Not ELL"' do
@ -680,6 +684,13 @@ RSpec.describe SurveyItemValues, type: :model do
expect(values.sped).to eq "Not Special Education"
end
it 'translates "not sped" into "Not Special Education' do
headers = ["Raw SpEd"]
row = { "Raw SpEd" => "Not SPED" }
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
expect(values.sped).to eq "Not Special Education"
end
it 'translates NA into "Unknown"' do
headers = ["Raw SpEd"]
row = { "Raw SpEd" => "NA" }

Loading…
Cancel
Save