mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
Merge branch 'rpp-response-rate' to bring in changes to test files
This commit is contained in:
commit
4c4ccc01cc
47 changed files with 48818 additions and 1354 deletions
|
|
@ -18,6 +18,11 @@ describe ResponseRateCalculator, type: :model do
|
|||
let(:insufficient_student_survey_item_1) { create(:student_survey_item, scale: sufficient_scale_1) }
|
||||
let(:sufficient_student_survey_item_2) { create(:student_survey_item, scale: sufficient_scale_2) }
|
||||
|
||||
context '.grades_with_sufficient_responses' do
|
||||
pending 'implement this'
|
||||
before :each do
|
||||
end
|
||||
end
|
||||
context 'when a students take a regular survey' do
|
||||
context 'when the average number of student responses per question in a subcategory is equal to the student response threshold' do
|
||||
before :each do
|
||||
|
|
|
|||
|
|
@ -38,4 +38,34 @@ RSpec.describe SurveyItem, type: :model do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '.survey_type_for_grade' do
|
||||
let(:early_education_survey_item1) { create(:early_education_survey_item, scale:) }
|
||||
context 'when no responses exist' do
|
||||
it 'it returns back a regular survey' do
|
||||
expect(SurveyItem.survey_type_for_grade(school, academic_year, 0)).to eq :regular
|
||||
end
|
||||
end
|
||||
|
||||
context 'when some responses exist' do
|
||||
context 'and the responses are only within the set of early education survey items' do
|
||||
before :each do
|
||||
create(:survey_item_response, survey_item: early_education_survey_item1, school:, academic_year:, grade: 0)
|
||||
end
|
||||
|
||||
it 'reports the survey type as early education' do
|
||||
expect(SurveyItem.survey_type_for_grade(school, academic_year, 0)).to eq :early_education
|
||||
end
|
||||
end
|
||||
|
||||
context 'when there are responses for both early education and regular survey items' do
|
||||
before :each do
|
||||
create(:survey_item_response, school:, academic_year:, grade: 0)
|
||||
end
|
||||
it 'reports the survey type as regular' do
|
||||
expect(SurveyItem.survey_type_for_grade(school, academic_year, 0)).to eq :regular
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue