Rename DataAvailability to Summary

This commit is contained in:
rebuilt 2023-04-20 20:58:15 -07:00
parent 09963c3323
commit 0ed6cbe6b4
8 changed files with 74 additions and 22 deletions

View file

@ -85,9 +85,9 @@ describe AdminDataPresenter do
measure_id: measure_1A_i.measure_id, admin_data_items: measure_1A_i.admin_data_items, has_sufficient_data: true, school:, academic_year:
).descriptions_and_availability
).to eq [
DataAvailability.new('a-exp-i1', 'Percentage teachers with 5+ years of experience', true),
DataAvailability.new('a-exp-i2', 'Percentage teachers National Board certified', false),
DataAvailability.new('a-exp-i3', 'Percentage teachers teaching in area of licensure', false)
Summary.new('a-exp-i1', 'Percentage teachers with 5+ years of experience', true),
Summary.new('a-exp-i2', 'Percentage teachers National Board certified', false),
Summary.new('a-exp-i3', 'Percentage teachers teaching in area of licensure', false)
]
end
end
@ -98,9 +98,9 @@ describe AdminDataPresenter do
measure_id: measure_1A_i.measure_id, admin_data_items: measure_1A_i.admin_data_items, has_sufficient_data: true, school:, academic_year:
).descriptions_and_availability
).to eq [
DataAvailability.new('a-exp-i1', 'Percentage teachers with 5+ years of experience', false),
DataAvailability.new('a-exp-i2', 'Percentage teachers National Board certified', false),
DataAvailability.new('a-exp-i3', 'Percentage teachers teaching in area of licensure', false)
Summary.new('a-exp-i1', 'Percentage teachers with 5+ years of experience', false),
Summary.new('a-exp-i2', 'Percentage teachers National Board certified', false),
Summary.new('a-exp-i3', 'Percentage teachers teaching in area of licensure', false)
]
end
end

View file

@ -0,0 +1,49 @@
require 'rails_helper'
describe StudentSurveyPresenter do
let(:school) { nil }
let(:academic_year) { nil }
let(:measure_1A_i) { create(:measure, measure_id: '1A-i') }
let(:scale_1) { create(:student_scale, measure: measure_1A_i) }
let(:survey_item_1) do
create(:student_survey_item, survey_item_id: 's-sbel-q1', scale: scale_1,
prompt: 'I am happy when I am in class.')
end
let(:survey_item_2) do
create(:student_survey_item, survey_item_id: 's-sbel-q2', scale: scale_1,
prompt: 'My teacher gives me help when I need it.')
end
let(:survey_item_3) do
create(:student_survey_item, survey_item_id: 's-sbel-es1', scale: scale_1,
prompt: 'This prompt should not show up')
end
let(:measure_1B_i) { create(:measure, measure_id: '1B-i') }
before do
scale_1
survey_item_1
survey_item_2
survey_item_3
end
describe '#descriptions_and_availability' do
context 'When there is a survey item with a blank prompt' do
it 'returns a list containing the survey item properties excluding survey items with blank prompts' do
result = StudentSurveyPresenter.new(
measure_id: measure_1A_i.measure_id,
survey_items: measure_1A_i.student_survey_items,
has_sufficient_data: true,
school:,
academic_year:
).descriptions_and_availability
expect(
result
).to eq [
Summary.new('s-sbel-q1',
'I am happy when I am in class.', true),
Summary.new('s-sbel-q2',
'My teacher gives me help when I need it.', true)
]
end
end
end
end

View file

@ -66,12 +66,12 @@ describe TeacherSurveyPresenter do
academic_year:
).descriptions_and_availability
).to eq [
DataAvailability.new('t-1',
'Given your preparation for teaching how comfortable are you teaching at the grade-level you have been assigned?', true),
DataAvailability.new('t-2',
'How prepared are you for teaching the topics that you are expected to teach in your assignment?', true),
DataAvailability.new('t-3',
'How confident are you in working with the student body at your school?', true)
Summary.new('t-1',
'Given your preparation for teaching how comfortable are you teaching at the grade-level you have been assigned?', true),
Summary.new('t-2',
'How prepared are you for teaching the topics that you are expected to teach in your assignment?', true),
Summary.new('t-3',
'How confident are you in working with the student body at your school?', true)
]
end
end
@ -86,7 +86,7 @@ describe TeacherSurveyPresenter do
academic_year:
).descriptions_and_availability
).to eq [
DataAvailability.new('1B-i', 'Items available upon request to MCIEA.', true)
Summary.new('1B-i', 'Items available upon request to MCIEA', true)
]
end
end