mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
feat: add special education disaggregation
This commit is contained in:
parent
a9b4f97a84
commit
acfdaf5587
23 changed files with 379 additions and 52 deletions
22
spec/fixtures/sample_demographics.csv
vendored
22
spec/fixtures/sample_demographics.csv
vendored
|
|
@ -1,11 +1,11 @@
|
|||
Race Qualtrics Code,Race/Ethnicity,Gender Qualtrics Code,Sex/Gender,Income,ELL
|
||||
1,American Indian or Alaskan Native,2,Male,Economically Disadvantaged – N,ELL
|
||||
2,Asian or Pacific Islander,1,Female,Economically Disadvantaged – Y,Not ELL
|
||||
3,Black or African American,4,Non-Binary,Unknown,Unknown
|
||||
4,Hispanic or Latinx,99,Unknown,,
|
||||
5,White or Caucasian,,,,
|
||||
6,Prefer not to disclose,,,,
|
||||
7,Prefer to self-describe,,,,
|
||||
8,Middle Eastern,,,,
|
||||
99,Race/Ethnicity Not Listed,,,,
|
||||
100,Multiracial,,,,
|
||||
Race Qualtrics Code,Race/Ethnicity,Gender Qualtrics Code,Sex/Gender,Income,ELL,Special Ed Status
|
||||
1,American Indian or Alaskan Native,2,Male,Economically Disadvantaged – N,ELL,Special Education
|
||||
2,Asian or Pacific Islander,1,Female,Economically Disadvantaged – Y,Not ELL,Not Special Education
|
||||
3,Black or African American,4,Non-Binary,Unknown,Unknown,Unknown
|
||||
4,Hispanic or Latinx,99,Unknown,,,
|
||||
5,White or Caucasian,,,,,
|
||||
6,Prefer not to disclose,,,,,
|
||||
7,Prefer to self-describe,,,,,
|
||||
8,Middle Eastern,,,,,
|
||||
99,Race/Ethnicity Not Listed,,,,,
|
||||
100,Multiracial,,,,,
|
||||
|
|
|
|||
|
|
|
@ -21,6 +21,10 @@ describe DemographicLoader do
|
|||
["ELL", "Not ELL", "Unknown"]
|
||||
end
|
||||
|
||||
let(:speds) do
|
||||
["Special Education", "Not Special Education", "Unknown"]
|
||||
end
|
||||
|
||||
before :each do
|
||||
DemographicLoader.load_data(filepath:)
|
||||
end
|
||||
|
|
@ -68,5 +72,12 @@ describe DemographicLoader do
|
|||
expect(Ell.find_by_designation(ell).designation).to eq ell
|
||||
end
|
||||
end
|
||||
|
||||
it "load all the special ed designations" do
|
||||
expect(Sped.all.count).to eq 3
|
||||
speds.each do |sped|
|
||||
expect(Sped.find_by_designation(sped).designation).to eq sped
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -251,6 +251,44 @@ RSpec.describe SurveyItemValues, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
context ".sped" do
|
||||
before :each do
|
||||
attleboro
|
||||
ay_2022_23
|
||||
end
|
||||
|
||||
it 'translates "active" into "Special Education"' do
|
||||
headers = ["Raw SpEd"]
|
||||
row = { "Raw SpEd" => "active" }
|
||||
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
|
||||
expect(values.sped).to eq "Special Education"
|
||||
end
|
||||
|
||||
it 'translates "exited" into "Not Special Education"' do
|
||||
headers = ["Raw SpEd"]
|
||||
row = { "Raw SpEd" => "exited" }
|
||||
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
|
||||
expect(values.sped).to eq "Not Special Education"
|
||||
end
|
||||
it 'translates blanks into "Not Special Education' do
|
||||
headers = ["Raw SpEd"]
|
||||
row = { "Raw SpEd" => "" }
|
||||
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
|
||||
expect(values.sped).to eq "Not Special Education"
|
||||
end
|
||||
|
||||
it 'tranlsates NA into "Unknown"' do
|
||||
headers = ["Raw SpEd"]
|
||||
row = { "Raw SpEd" => "NA" }
|
||||
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
|
||||
expect(values.sped).to eq "Unknown"
|
||||
|
||||
row = { "Raw SpEd" => "#NA" }
|
||||
values = SurveyItemValues.new(row:, headers:, genders:, survey_items:, schools:)
|
||||
expect(values.sped).to eq "Unknown"
|
||||
end
|
||||
end
|
||||
|
||||
context ".valid_duration" do
|
||||
context "when duration is valid" do
|
||||
it "returns true" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue