Remove unused method; item_descriptions

pull/1/head
rebuilt 3 years ago
parent 6b4cfabb5a
commit a72fd373dc

@ -16,18 +16,15 @@ class TeacherSurveyPresenter < DataItemPresenter
"teacher-survey-items-#{@measure_id}"
end
def item_descriptions
return ['Items available upon request to MCIEA.'] if @measure_id == '1B-i'
@survey_items.map(&:prompt)
end
def reason_for_insufficiency
'low response rate'
end
def descriptions_and_availability
return [DataAvailability.new('1B-i', 'Items available upon request to MCIEA.', true)] if @measure_id == '1B-i'
if @measure_id == '1B-i'
return [DataAvailability.new('1B-i', 'Items available upon request to Lowell Public Schools.',
true)]
end
survey_items.map do |survey_item|
DataAvailability.new(survey_item.survey_item_id, survey_item.prompt, true)

@ -32,28 +32,6 @@ describe TeacherSurveyPresenter do
survey_item_4
end
describe '#item_description' do
context 'When the presenter is based on measure 1A-1' do
it 'returns a list of survey prompts for teacher survey items' do
expect(TeacherSurveyPresenter.new(measure_id: measure_1A_i.measure_id, survey_items: measure_1A_i.teacher_survey_items,
has_sufficient_data: true, school:, academic_year:).item_descriptions).to eq [
'Given your preparation for teaching how comfortable are you teaching at the grade-level you have been assigned?',
'How prepared are you for teaching the topics that you are expected to teach in your assignment?',
'How confident are you in working with the student body at your school?'
]
end
end
context 'When the presenter is based on measure 1B-i' do
it 'returns a message hiding the actual prompts. Instead it presents a message telling the user they can ask for more information' do
expect(TeacherSurveyPresenter.new(measure_id: measure_1B_i.measure_id, survey_items: measure_1B_i.teacher_survey_items,
has_sufficient_data: true, school:, academic_year:).item_descriptions).to eq [
'Items available upon request to MCIEA.'
]
end
end
end
describe '#descriptions_and_availability' do
context 'When the presenter is NOT based on measure 1B-i' do
it 'returns a list containing the survey item properties' do
@ -86,7 +64,7 @@ describe TeacherSurveyPresenter do
academic_year:
).descriptions_and_availability
).to eq [
DataAvailability.new('1B-i', 'Items available upon request to MCIEA.', true)
DataAvailability.new('1B-i', 'Items available upon request to Lowell Public Schools.', true)
]
end
end

@ -41,8 +41,6 @@ describe MeasurePresenter do
expect(measure_presenter.data_item_presenters.first.id).to eq 'teacher-survey-items-measure-id'
expect(measure_presenter.data_item_presenters.first.title).to eq 'Teacher survey'
expect(measure_presenter.data_item_presenters.first.data_item_accordion_id).to eq 'data-item-accordion-measure-id'
expect(measure_presenter.data_item_presenters.first.item_descriptions).to eq ['A teacher survey item prompt',
'Another teacher survey item prompt']
end
end
@ -61,15 +59,11 @@ describe MeasurePresenter do
expect(first_data_item_presenter.id).to eq 'teacher-survey-items-measure-id'
expect(first_data_item_presenter.title).to eq 'Teacher survey'
expect(first_data_item_presenter.data_item_accordion_id).to eq 'data-item-accordion-measure-id'
expect(first_data_item_presenter.item_descriptions).to eq ['A teacher survey item prompt',
'Another teacher survey item prompt']
second_data_item_presenter = measure_presenter.data_item_presenters[1]
expect(second_data_item_presenter.id).to eq 'admin-data-items-measure-id'
expect(second_data_item_presenter.title).to eq 'School admin data'
expect(second_data_item_presenter.data_item_accordion_id).to eq 'data-item-accordion-measure-id'
expect(second_data_item_presenter.item_descriptions).to eq ['An admin data item description',
'Another admin data item description']
end
end

Loading…
Cancel
Save