chore: Make sure 'hispanic' column only gets applied when using SIS race information

This commit is contained in:
Nelson Jovel 2023-12-12 10:53:07 -08:00
parent 2d6bbe0e5a
commit 41d942c214
2 changed files with 13 additions and 7 deletions

View file

@ -415,8 +415,9 @@ RSpec.describe SurveyItemValues, type: :model do
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
expect(values.races.map { |race| race&.qualtrics_code }).to eq [5, 2, 3, 100]
row = { "Race" => "Caucasian and Asian and African American", "HispanicLatino" => "true" }
row = { "Race- SIS" => "Caucasian and Asian and African American", "HispanicLatino" => "true" }
headers.push("HispanicLatino")
headers.push("Race- SIS")
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
expect(values.races.map { |race| race&.qualtrics_code }).to eq [5, 2, 3, 4, 100]
end