rename admin data to school data

This commit is contained in:
rebuilt 2023-03-21 15:43:25 -07:00
parent 25f839e728
commit 1595c3a58c
8 changed files with 194 additions and 194 deletions

View file

@ -1,42 +1,42 @@
require 'rails_helper'
require "rails_helper"
include VarianceHelper
describe 'overview/index' do
describe "overview/index" do
subject { Nokogiri::HTML(rendered) }
let(:support_for_teaching) do
measure = create(:measure, name: 'Support For Teaching Development & Growth', measure_id: '1')
measure = create(:measure, name: "Support For Teaching Development & Growth", measure_id: "1")
scale = create(:scale, measure:)
create(:student_survey_item,
scale:,
watch_low_benchmark: 1.5,
growth_low_benchmark: 2.5,
approval_low_benchmark: 3.5,
ideal_low_benchmark: 4.5)
scale:,
watch_low_benchmark: 1.5,
growth_low_benchmark: 2.5,
approval_low_benchmark: 3.5,
ideal_low_benchmark: 4.5)
measure
end
let(:effective_leadership) do
measure = create(:measure, name: 'Effective Leadership', measure_id: '2')
measure = create(:measure, name: "Effective Leadership", measure_id: "2")
scale = create(:scale, measure:)
create(:teacher_survey_item,
scale:,
watch_low_benchmark: 1.5,
growth_low_benchmark: 2.5,
approval_low_benchmark: 3.5,
ideal_low_benchmark: 4.5)
scale:,
watch_low_benchmark: 1.5,
growth_low_benchmark: 2.5,
approval_low_benchmark: 3.5,
ideal_low_benchmark: 4.5)
measure
end
let(:professional_qualifications) do
measure = create(:measure, name: 'Professional Qualifications', measure_id: '3')
measure = create(:measure, name: "Professional Qualifications", measure_id: "3")
scale = create(:scale, measure:)
create(:admin_data_item,
scale:,
watch_low_benchmark: 1.5,
growth_low_benchmark: 2.5,
approval_low_benchmark: 3.5,
ideal_low_benchmark: 4.5)
scale:,
watch_low_benchmark: 1.5,
growth_low_benchmark: 2.5,
approval_low_benchmark: 3.5,
ideal_low_benchmark: 4.5)
measure
end
@ -49,12 +49,12 @@ describe 'overview/index' do
@school = create(:school)
ResponseRate.create!(subcategory: Subcategory.first, school: @school, academic_year: @academic_year,
student_response_rate: 100, teacher_response_rate: 100, meets_student_threshold: true, meets_teacher_threshold: true)
student_response_rate: 100, teacher_response_rate: 100, meets_student_threshold: true, meets_teacher_threshold: true)
render
end
context 'when some presenters have a nil score' do
context "when some presenters have a nil score" do
let(:variance_chart_row_presenters) do
[
VarianceChartRowPresenter.new(measure: support_for_teaching, score: Score.new),
@ -63,49 +63,49 @@ describe 'overview/index' do
]
end
it 'displays a note detailing which measures have insufficient responses for the given school & academic year' do
expect(rendered).to match %r{Note: The following measures are not displayed due to limited availability of school admin data and/or low survey response rates: Support For Teaching Development & Growth; Professional Qualifications.}
it "displays a note detailing which measures have insufficient responses for the given school & academic year" do
expect(rendered).to match %r{Note: The following measures are not displayed due to limited availability of school data and/or low survey response rates: Support For Teaching Development & Growth; Professional Qualifications.}
end
it 'displays a variance row and label only those presenters for which the score is not nil' do
displayed_variance_rows = subject.css('[data-for-measure-id]')
it "displays a variance row and label only those presenters for which the score is not nil" do
displayed_variance_rows = subject.css("[data-for-measure-id]")
expect(displayed_variance_rows.count).to eq 1
expect(displayed_variance_rows.first.attribute('data-for-measure-id').value).to eq '2'
expect(displayed_variance_rows.first.attribute("data-for-measure-id").value).to eq "2"
displayed_variance_labels = subject.css('[data-variance-row-label]')
displayed_variance_labels = subject.css("[data-variance-row-label]")
expect(displayed_variance_labels.count).to eq 1
expect(displayed_variance_labels.first.inner_text).to include 'Effective Leadership'
expect(displayed_variance_labels.first.inner_text).to include "Effective Leadership"
end
end
context 'when all the presenters have a non-nil score' do
context "when all the presenters have a non-nil score" do
let(:variance_chart_row_presenters) do
measure = create(:measure, name: 'Display Me', measure_id: 'display-me')
measure = create(:measure, name: "Display Me", measure_id: "display-me")
scale = create(:scale, measure:)
create(:student_survey_item,
scale:,
watch_low_benchmark: 1.5,
growth_low_benchmark: 2.5,
approval_low_benchmark: 3.5,
ideal_low_benchmark: 4.5)
scale:,
watch_low_benchmark: 1.5,
growth_low_benchmark: 2.5,
approval_low_benchmark: 3.5,
ideal_low_benchmark: 4.5)
[
VarianceChartRowPresenter.new(measure:,
score: Score.new(average: rand))
score: Score.new(average: rand))
]
end
it 'does not display a note detailing which measures have insufficient responses for the given school & academic year' do
expect(rendered).not_to match %r{Note: The following measures are not displayed due to limited availability of school admin data and/or low survey response rates}
it "does not display a note detailing which measures have insufficient responses for the given school & academic year" do
expect(rendered).not_to match %r{Note: The following measures are not displayed due to limited availability of school data and/or low survey response rates}
end
it 'displays a variance row for each presenter' do
displayed_variance_rows = subject.css('[data-for-measure-id]')
it "displays a variance row for each presenter" do
displayed_variance_rows = subject.css("[data-for-measure-id]")
expect(displayed_variance_rows.count).to eq 1
expect(displayed_variance_rows.first.attribute('data-for-measure-id').value).to eq 'display-me'
expect(displayed_variance_rows.first.attribute("data-for-measure-id").value).to eq "display-me"
displayed_variance_labels = subject.css('[data-variance-row-label]')
displayed_variance_labels = subject.css("[data-variance-row-label]")
expect(displayed_variance_labels.count).to eq 1
expect(displayed_variance_labels.first.inner_text).to include 'Display Me'
expect(displayed_variance_labels.first.inner_text).to include "Display Me"
end
end
end