Skip to content

Commit

Permalink
Tests/Survey/Response: Update helper rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
barnden committed Apr 19, 2024
1 parent 85ad0eb commit b6933ab
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion rails_root/spec/helpers/survey_responses_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,24 @@
end
end

describe '#teacher_average_by_part' do
it 'returns a list of average responses for each question for each teacher survey response grouped by part' do
survey_answers

expected = [{ 1 => 2.0 }, {}, {}, {}]

expect(helper.teacher_average_by_part(survey_response)).to eq expected
end


it 'returns a list of empty hashes when response has no corresponding teachers' do
expected = [{}, {}, {}, {}]
expect(helper.teacher_average_by_part(survey_response)).to eq expected
end
end

describe '#average_of_teachers' do
it 'returns a list of average scores of survey responses of teachers' do
it 'returns a list of average responses for each question for each teacher survey response' do
# returns average score of the survey response answers
survey_answers
averages = Array.new(97, nil)
Expand Down Expand Up @@ -176,6 +192,28 @@
expect(helper.get_answer(survey_response, 1)).to eq(nil)
end
end

describe '#get_part_difference' do
it 'returns a list the average difference in choices by part against the superintendent' do
survey_answers


expected = [0, 0, 0, 0]

other_response = helper.find_superintendent(survey_response)
expect(helper.get_part_difference(survey_response, other_response)).to eq expected
end
end

describe '#get_teacher_part_difference' do
it 'returns a list the average difference in choices by part against the average teacher' do
survey_answers

expected = [0, 0, 0, 0]
expect(helper.get_teacher_part_difference(survey_response)).to eq expected
end
end
end


# rubocop:enable Metrics/BlockLength

0 comments on commit b6933ab

Please sign in to comment.