From 7dbb0253571d7e8382e7c57cdb7a93039db6bb55 Mon Sep 17 00:00:00 2001 From: rebuilt Date: Thu, 8 Jun 2023 15:26:29 -0700 Subject: [PATCH] Revert "Add tests to codify behavior of weighted average logic" This reverts commit be26efbecae873819398aaeb839713e77752011a. --- spec/models/response_rate_calculator_spec.rb | 30 -------------------- 1 file changed, 30 deletions(-) diff --git a/spec/models/response_rate_calculator_spec.rb b/spec/models/response_rate_calculator_spec.rb index 6a89dece..08ba51d1 100644 --- a/spec/models/response_rate_calculator_spec.rb +++ b/spec/models/response_rate_calculator_spec.rb @@ -159,36 +159,6 @@ describe ResponseRateCalculator, type: :model do end end - context 'when two grades have different numbers of students' do - before do - create(:respondent, school:, academic_year:, total_students: 60, one: 40, two: 20) - create_list(:survey_item_response, 20, survey_item: sufficient_student_survey_item_1, academic_year:, - school:, grade: 1) # 50% - create_list(:survey_item_response, 15, survey_item: sufficient_student_survey_item_2, academic_year:, - school:, grade: 2) # 75% - end - it 'weights the average response rate by the number of students in each grade' do - expect(StudentResponseRateCalculator.new(subcategory:, school:, - academic_year:).rate).to be_within(0.01).of(58.333333) - end - end - - context 'when three grades have different numbers of students' do - before do - create(:respondent, school:, academic_year:, total_students: 120, one: 40, two: 20, three: 60) - create_list(:survey_item_response, 20, survey_item: sufficient_student_survey_item_1, academic_year:, - school:, grade: 1) # 50% - create_list(:survey_item_response, 15, survey_item: sufficient_student_survey_item_2, academic_year:, - school:, grade: 2) # 75% - create_list(:survey_item_response, 15, survey_item: sufficient_student_survey_item_2, academic_year:, - school:, grade: 3) # 25% - end - it 'weights the average response rate by the number of students in each grade' do - expect(StudentResponseRateCalculator.new(subcategory:, school:, - academic_year:).rate).to be_within(0.01).of(41.6666) - end - end - context 'when one grade gets surveyed but another does not, the grade that does not get surveyed is not counted' do before do create(:respondent, school:, academic_year:, total_students: 20, one: 20, two: 20)