mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
fix: make sure all likert scores get counted even when the survey item id has different capitalization. Add tests for uploading parent data. Change the parent response rate calcuation to count all students in the school instead of just for the grades that were given the student survey
This commit is contained in:
parent
2994cd8df9
commit
beb93aa8e8
12 changed files with 196 additions and 50 deletions
|
|
@ -107,6 +107,14 @@ RSpec.describe SurveyItemValues, type: :model do
|
|||
(survey_item_ids << common_headers).flatten
|
||||
end
|
||||
|
||||
context ".normalize_headers" do
|
||||
it "normalizes the headers to remove invisible newlines and lowercase survey item ids" do
|
||||
headers = [ " p-tcom-q1\n", " P-tcom-q2\r\n ", " P-tcom-q3 " ]
|
||||
normalized_headers = SurveyItemValues.new(row: {}, headers:, survey_items:, schools:, academic_years:).normalize_headers(headers:)
|
||||
expect(normalized_headers).to eq ["p-tcom-q1", "p-tcom-q2", "p-tcom-q3"]
|
||||
end
|
||||
end
|
||||
|
||||
context ".recorded_date" do
|
||||
it "returns the recorded date" do
|
||||
row = { "RecordedDate" => "2017-01-01T12:12:121" }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue