diff --git a/spec/presenters/scorecard_presenter_spec.rb b/spec/presenters/scorecard_presenter_spec.rb
new file mode 100644
index 00000000..3ce76dff
--- /dev/null
+++ b/spec/presenters/scorecard_presenter_spec.rb
@@ -0,0 +1,89 @@
+require "rails_helper"
+
+describe Overview::ScorecardPresenter do
+ let(:zones) do
+ Zones.new(
+ watch_low_benchmark: 1.5,
+ growth_low_benchmark: 2.5,
+ approval_low_benchmark: 3.5,
+ ideal_low_benchmark: 4.5
+ )
+ end
+
+ let(:subcategory_card_presenter) do
+ subcategory = Subcategory.new(name: "A subcategory")
+ Overview::ScorecardPresenter.new(construct: subcategory, zones:, score:, id: subcategory.subcategory_id)
+ end
+
+ context "when the given score is in the Warning zone for the given scale" do
+ let(:score) { 1 }
+
+ it "returns the icon that represents the zone" do
+ expect(subcategory_card_presenter.harvey_ball_icon).to eq "warning-harvey-ball"
+ end
+
+ it "returns the color class of the zone" do
+ expect(subcategory_card_presenter.color).to eq "warning"
+ end
+ end
+
+ context "when the given score is in the Watch zone for the given scale" do
+ let(:score) { 2 }
+
+ it "returns the icon that represents the zone" do
+ expect(subcategory_card_presenter.harvey_ball_icon).to eq "watch-harvey-ball"
+ end
+
+ it "returns the color class of the zone" do
+ expect(subcategory_card_presenter.color).to eq "watch"
+ end
+ end
+
+ context "when the given score is in the Growth zone for the given scale" do
+ let(:score) { 3 }
+
+ it "returns the icon that represents the zone" do
+ expect(subcategory_card_presenter.harvey_ball_icon).to eq "growth-harvey-ball"
+ end
+
+ it "returns the color class of the zone" do
+ expect(subcategory_card_presenter.color).to eq "growth"
+ end
+ end
+
+ context "when the given score is in the Approval zone for the given scale" do
+ let(:score) { 4 }
+
+ it "returns the icon that represents the zone" do
+ expect(subcategory_card_presenter.harvey_ball_icon).to eq "approval-harvey-ball"
+ end
+
+ it "returns the color class of the zone" do
+ expect(subcategory_card_presenter.color).to eq "approval"
+ end
+ end
+
+ context "when the given score is in the Ideal zone for the given scale" do
+ let(:score) { 5 }
+
+ it "returns the icon that represents the zone" do
+ expect(subcategory_card_presenter.harvey_ball_icon).to eq "ideal-harvey-ball"
+ end
+
+ it "returns the color class of the zone" do
+ expect(subcategory_card_presenter.color).to eq "ideal"
+ end
+ end
+
+ context "when the given score is invalid for the given scale" do
+ let(:score) { 0 }
+
+ it "returns the icon that represents the zone" do
+ expect(subcategory_card_presenter.harvey_ball_icon).to eq "insufficient_data-harvey-ball"
+ end
+
+ it "reports that there is insufficient data" do
+ expect(subcategory_card_presenter.insufficient_data?).to be true
+ end
+ end
+end
diff --git a/spec/presenters/subcategory_card_presenter_spec.rb b/spec/presenters/subcategory_card_presenter_spec.rb
deleted file mode 100644
index 627f7934..00000000
--- a/spec/presenters/subcategory_card_presenter_spec.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-require 'rails_helper'
-
-describe SubcategoryCardPresenter do
- let(:zones) do
- Zones.new(
- watch_low_benchmark: 1.5,
- growth_low_benchmark: 2.5,
- approval_low_benchmark: 3.5,
- ideal_low_benchmark: 4.5
- )
- end
-
- let(:subcategory_card_presenter) { SubcategoryCardPresenter.new(subcategory: Subcategory.new(name: 'A subcategory'), zones:, score:) }
-
- context 'when the given score is in the Warning zone for the given scale' do
- let(:score) { 1 }
-
- it 'returns the icon that represents the zone' do
- expect(subcategory_card_presenter.harvey_ball_icon).to eq 'warning-harvey-ball'
- end
-
- it 'returns the color class of the zone' do
- expect(subcategory_card_presenter.color).to eq 'warning'
- end
- end
-
- context 'when the given score is in the Watch zone for the given scale' do
- let(:score) { 2 }
-
- it 'returns the icon that represents the zone' do
- expect(subcategory_card_presenter.harvey_ball_icon).to eq 'watch-harvey-ball'
- end
-
- it 'returns the color class of the zone' do
- expect(subcategory_card_presenter.color).to eq 'watch'
- end
- end
-
- context 'when the given score is in the Growth zone for the given scale' do
- let(:score) { 3 }
-
- it 'returns the icon that represents the zone' do
- expect(subcategory_card_presenter.harvey_ball_icon).to eq 'growth-harvey-ball'
- end
-
- it 'returns the color class of the zone' do
- expect(subcategory_card_presenter.color).to eq 'growth'
- end
- end
-
- context 'when the given score is in the Approval zone for the given scale' do
- let(:score) { 4 }
-
- it 'returns the icon that represents the zone' do
- expect(subcategory_card_presenter.harvey_ball_icon).to eq 'approval-harvey-ball'
- end
-
- it 'returns the color class of the zone' do
- expect(subcategory_card_presenter.color).to eq 'approval'
- end
- end
-
- context 'when the given score is in the Ideal zone for the given scale' do
- let(:score) { 5 }
-
- it 'returns the icon that represents the zone' do
- expect(subcategory_card_presenter.harvey_ball_icon).to eq 'ideal-harvey-ball'
- end
-
- it 'returns the color class of the zone' do
- expect(subcategory_card_presenter.color).to eq 'ideal'
- end
- end
-
- context 'when the given score is invalid for the given scale' do
- let(:score) { 0 }
-
- it 'returns the icon that represents the zone' do
- expect(subcategory_card_presenter.harvey_ball_icon).to eq 'insufficient_data-harvey-ball'
- end
-
- it 'reports that there is insufficient data' do
- expect(subcategory_card_presenter.insufficient_data?).to be true
- end
- end
-end
diff --git a/spec/presenters/subcategory_presenter_spec.rb b/spec/presenters/subcategory_presenter_spec.rb
index dfd0c22d..a225fdeb 100644
--- a/spec/presenters/subcategory_presenter_spec.rb
+++ b/spec/presenters/subcategory_presenter_spec.rb
@@ -85,16 +85,6 @@ describe SubcategoryPresenter do
expect(subcategory_presenter.measure_presenters.count).to eq subcategory.measures.count
end
- context "When there are no measures populated with student or teacher surveys" do
- let(:empty_subcategory) { create :subcategory }
- let(:empty_subcategory_presenter) do
- SubcategoryPresenter.new(subcategory: empty_subcategory, academic_year:, school:)
- end
- it "should make a subcategory presenter return insufficient data" do
- expect(empty_subcategory_presenter.subcategory_card_presenter.insufficient_data?).to eq true
- end
- end
-
def create_survey_item_responses_for_different_years_and_schools(survey_item)
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD, survey_item:,
school: worst_school, likert_score: 1)
diff --git a/spec/presenters/variance_chart_row_presenter_spec.rb b/spec/presenters/variance_chart_row_presenter_spec.rb
index 0d33e826..aea82f78 100644
--- a/spec/presenters/variance_chart_row_presenter_spec.rb
+++ b/spec/presenters/variance_chart_row_presenter_spec.rb
@@ -1,6 +1,6 @@
require "rails_helper"
-describe VarianceChartRowPresenter do
+describe Overview::VarianceChartRowPresenter do
let(:watch_low_benchmark) { 2.9 }
let(:growth_low_benchmark) { 3.1 }
let(:approval_low_benchmark) { 3.6 }
@@ -30,7 +30,7 @@ describe VarianceChartRowPresenter do
end
let(:presenter) do
- VarianceChartRowPresenter.new measure:, score:
+ Overview::VarianceChartRowPresenter.new measure:, score:
end
shared_examples_for "measure_name" do
@@ -138,9 +138,19 @@ describe VarianceChartRowPresenter do
context "when a measure does not contain admin data items" do
let(:score) { Score.new(average: nil, meets_teacher_threshold: false, meets_student_threshold: false) }
+<<<<<<< HEAD
it "it does not show a partial data indicator" do
presenter_without_admin_data = VarianceChartRowPresenter.new measure: measure_without_admin_data_items,
score: score
+||||||| parent of a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
+ it 'it does not show a partial data indicator' do
+ presenter_without_admin_data = VarianceChartRowPresenter.new measure: measure_without_admin_data_items,
+ score: score
+=======
+ it "it does not show a partial data indicator" do
+ presenter_without_admin_data = Overview::VarianceChartRowPresenter.new(measure: measure_without_admin_data_items,
+ score:)
+>>>>>>> a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
expect(presenter_without_admin_data.show_partial_data_indicator?).to be false
end
end
@@ -157,6 +167,7 @@ describe VarianceChartRowPresenter do
name: "Some Title"
)
scale_with_admin_data = create(:scale, measure: measure_with_admin_data)
+<<<<<<< HEAD
create :admin_data_item,
scale: scale_with_admin_data,
watch_low_benchmark: watch_low_benchmark,
@@ -167,8 +178,37 @@ describe VarianceChartRowPresenter do
score: Score.new(
average: 3.7, meets_teacher_threshold: true, meets_student_threshold: true
)
+||||||| parent of a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
+ create :admin_data_item,
+ scale: scale_with_admin_data,
+ watch_low_benchmark: watch_low_benchmark,
+ growth_low_benchmark: growth_low_benchmark,
+ approval_low_benchmark: approval_low_benchmark,
+ ideal_low_benchmark: ideal_low_benchmark
+ admin_data_presenter = VarianceChartRowPresenter.new measure: measure_with_admin_data,
+ score: Score.new(
+ average: 3.7, meets_teacher_threshold: true, meets_student_threshold: true
+ )
+=======
+ create(:admin_data_item,
+ scale: scale_with_admin_data,
+ watch_low_benchmark:,
+ growth_low_benchmark:,
+ approval_low_benchmark:,
+ ideal_low_benchmark:)
+ admin_data_presenter = Overview::VarianceChartRowPresenter.new measure: measure_with_admin_data,
+ score: Score.new(
+ average: 3.7, meets_teacher_threshold: true, meets_student_threshold: true
+ )
+>>>>>>> a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
expect(admin_data_presenter.show_partial_data_indicator?).to be true
+<<<<<<< HEAD
expect(admin_data_presenter.partial_data_sources).to eq ["school data"]
+||||||| parent of a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
+ expect(admin_data_presenter.partial_data_sources).to eq ['administrative data']
+=======
+ expect(admin_data_presenter.partial_data_sources).to eq ["administrative data"]
+>>>>>>> a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
end
end
@@ -186,9 +226,19 @@ describe VarianceChartRowPresenter do
end
end
+<<<<<<< HEAD
context "when there are sufficient teacher survey item responses" do
let(:score) { Score.new(average: nil, meets_teacher_threshold: true, meets_student_threshold: true) }
it "does not show a partial data indicator" do
+||||||| parent of a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
+ context 'when there are sufficient teacher survey item responses' do
+ let(:score) { Score.new(average: nil, meets_teacher_threshold: true, meets_student_threshold: true) }
+ it 'does not show a partial data indicator' do
+=======
+ context "when there are sufficient teacher survey item responses" do
+ let(:score) { Score.new(average: nil, meets_teacher_threshold: true, meets_student_threshold: true) }
+ it "does not show a partial data indicator" do
+>>>>>>> a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
expect(presenter.show_partial_data_indicator?).to be false
end
end
@@ -213,8 +263,16 @@ describe VarianceChartRowPresenter do
create :admin_data_item, scale:
end
+<<<<<<< HEAD
it "returns the sources for partial results of administrative data and student survey results" do
expect(presenter.partial_data_sources).to eq ["student survey results", "school data"]
+||||||| parent of a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
+ it 'returns the sources for partial results of administrative data and student survey results' do
+ expect(presenter.partial_data_sources).to eq ['student survey results', 'administrative data']
+=======
+ it "returns the sources for partial results of administrative data and student survey results" do
+ expect(presenter.partial_data_sources).to eq ["student survey results", "administrative data"]
+>>>>>>> a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
end
end
end
@@ -231,6 +289,7 @@ describe VarianceChartRowPresenter do
it "selects a longer bar before a shorter bar for measures in the approval/ideal zones" do
scale_with_student_survey_items = create(:scale, measure:)
create(:student_survey_item,
+<<<<<<< HEAD
scale: scale_with_student_survey_items,
watch_low_benchmark:,
growth_low_benchmark:,
@@ -238,13 +297,52 @@ describe VarianceChartRowPresenter do
ideal_low_benchmark:)
approval_presenter = VarianceChartRowPresenter.new measure: measure, score: Score.new(average: 3.7, meets_teacher_threshold: true, meets_student_threshold: true)
ideal_presenter = VarianceChartRowPresenter.new measure: measure, score: Score.new(average: 4.4, meets_teacher_threshold: true, meets_student_threshold: true)
+||||||| parent of a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
+ scale: scale_with_student_survey_items,
+ watch_low_benchmark:,
+ growth_low_benchmark:,
+ approval_low_benchmark:,
+ ideal_low_benchmark:)
+ approval_presenter = VarianceChartRowPresenter.new measure: measure, score: Score.new(average: 3.7, meets_teacher_threshold: true,meets_student_threshold: true)
+ ideal_presenter = VarianceChartRowPresenter.new measure: measure, score: Score.new(average: 4.4, meets_teacher_threshold: true, meets_student_threshold: true)
+=======
+ scale: scale_with_student_survey_items,
+ watch_low_benchmark:,
+ growth_low_benchmark:,
+ approval_low_benchmark:,
+ ideal_low_benchmark:)
+ approval_presenter = Overview::VarianceChartRowPresenter.new measure:,
+ score: Score.new(
+ average: 3.7, meets_teacher_threshold: true, meets_student_threshold: true
+ )
+ ideal_presenter = Overview::VarianceChartRowPresenter.new measure:,
+ score: Score.new(
+ average: 4.4, meets_teacher_threshold: true, meets_student_threshold: true
+ )
+>>>>>>> a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
expect(ideal_presenter <=> approval_presenter).to be < 0
expect([approval_presenter, ideal_presenter].sort).to eq [ideal_presenter, approval_presenter]
end
+<<<<<<< HEAD
it "selects a warning bar below a ideal bar" do
warning_presenter = VarianceChartRowPresenter.new measure: measure, score: Score.new(average: 1.0, meets_teacher_threshold: true, meets_student_threshold: true)
ideal_presenter = VarianceChartRowPresenter.new measure: measure, score: Score.new(average: 5.0, meets_teacher_threshold: true, meets_student_threshold: true)
+||||||| parent of a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
+ it 'selects a warning bar below a ideal bar' do
+ warning_presenter = VarianceChartRowPresenter.new measure: measure, score: Score.new(average: 1.0, meets_teacher_threshold: true, meets_student_threshold: true)
+ ideal_presenter = VarianceChartRowPresenter.new measure: measure, score: Score.new(average: 5.0, meets_teacher_threshold: true, meets_student_threshold: true)
+=======
+ it "selects a warning bar below a ideal bar" do
+ warning_presenter = Overview::VarianceChartRowPresenter.new measure:,
+ score: Score.new(
+ average: 1.0, meets_teacher_threshold: true, meets_student_threshold: true
+ )
+ ideal_presenter = Overview::VarianceChartRowPresenter.new measure:,
+ score: Score.new(
+ average: 5.0, meets_teacher_threshold: true, meets_student_threshold: true
+ )
+>>>>>>> a391acc (feat: Add parent button to overview page and alter 'School Quality Framework Indicators' section to show parent scales)
expect(warning_presenter <=> ideal_presenter).to be > 0
expect([warning_presenter, ideal_presenter].sort).to eq [ideal_presenter, warning_presenter]
end
diff --git a/spec/views/overview/index.html.erb_spec.rb b/spec/views/overview/index.html.erb_spec.rb
index 375744d3..a74ba6cd 100644
--- a/spec/views/overview/index.html.erb_spec.rb
+++ b/spec/views/overview/index.html.erb_spec.rb
@@ -40,31 +40,33 @@ describe "overview/index" do
measure
end
- before :each do
- assign :category_presenters, []
- assign :variance_chart_row_presenters, variance_chart_row_presenters
- @academic_year = create(:academic_year)
- assign :academic_years, [@academic_year]
- @district = create(:district)
- @school = create(:school)
- @student_response_rate_presenter = ResponseRatePresenter.new(focus: :student, school: @school,
- academic_year: @academic_year)
- @teacher_response_rate_presenter = ResponseRatePresenter.new(focus: :teacher, school: @school,
- academic_year: @academic_year)
-
- Respondent.create!(school: @school, academic_year: @academic_year, total_students: 40, total_teachers: 40)
- 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)
-
- render
- end
-
context "when some presenters have a nil score" do
+ before :each do
+ assign :category_presenters, []
+ assign :variance_chart_row_presenters, variance_chart_row_presenters
+ @academic_year = create(:academic_year)
+ assign :academic_years, [@academic_year]
+ @district = create(:district)
+ @school = create(:school)
+ assign :page,
+ Overview::OverviewPresenter.new(params: { view: "student" }, school: @school,
+ academic_year: @academic_year)
+ @student_response_rate_presenter = ResponseRatePresenter.new(focus: :student, school: @school,
+ academic_year: @academic_year)
+ @teacher_response_rate_presenter = ResponseRatePresenter.new(focus: :teacher, school: @school,
+ academic_year: @academic_year)
+
+ Respondent.create!(school: @school, academic_year: @academic_year, total_students: 40, total_teachers: 40)
+ 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)
+
+ render
+ end
let(:variance_chart_row_presenters) do
[
- VarianceChartRowPresenter.new(measure: support_for_teaching, score: Score.new),
- VarianceChartRowPresenter.new(measure: effective_leadership, score: Score.new(average: rand)),
- VarianceChartRowPresenter.new(measure: professional_qualifications, score: Score.new)
+ Overview::VarianceChartRowPresenter.new(measure: support_for_teaching, score: Score.new),
+ Overview::VarianceChartRowPresenter.new(measure: effective_leadership, score: Score.new(average: rand)),
+ Overview::VarianceChartRowPresenter.new(measure: professional_qualifications, score: Score.new)
]
end
@@ -84,6 +86,27 @@ describe "overview/index" do
end
context "when all the presenters have a non-nil score" do
+ before :each do
+ assign :category_presenters, []
+ assign :variance_chart_row_presenters, variance_chart_row_presenters
+ @academic_year = create(:academic_year)
+ assign :academic_years, [@academic_year]
+ @district = create(:district)
+ @school = create(:school)
+ assign :page,
+ Overview::OverviewPresenter.new(params: { view: "student" }, school: @school,
+ academic_year: @academic_year)
+ @student_response_rate_presenter = ResponseRatePresenter.new(focus: :student, school: @school,
+ academic_year: @academic_year)
+ @teacher_response_rate_presenter = ResponseRatePresenter.new(focus: :teacher, school: @school,
+ academic_year: @academic_year)
+
+ Respondent.create!(school: @school, academic_year: @academic_year, total_students: 40, total_teachers: 40)
+ 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)
+
+ render
+ end
let(:variance_chart_row_presenters) do
measure = create(:measure, name: "Display Me", measure_id: "display-me")
scale = create(:scale, measure:)
@@ -94,8 +117,8 @@ describe "overview/index" do
approval_low_benchmark: 3.5,
ideal_low_benchmark: 4.5)
[
- VarianceChartRowPresenter.new(measure:,
- score: Score.new(average: rand))
+ Overview::VarianceChartRowPresenter.new(measure:,
+ score: Score.new(average: rand))
]
end
@@ -113,4 +136,88 @@ describe "overview/index" do
expect(displayed_variance_labels.first.inner_text).to include "Display Me"
end
end
+
+ context "when the default view is shown" do
+ let(:variance_chart_row_presenters) do
+ 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)
+ [
+ Overview::VarianceChartRowPresenter.new(measure:,
+ score: Score.new(average: rand))
+ ]
+ end
+
+ before :each do
+ assign :category_presenters, []
+ assign :variance_chart_row_presenters, variance_chart_row_presenters
+ @academic_year = create(:academic_year)
+ assign :academic_years, [@academic_year]
+ @district = create(:district)
+ @school = create(:school)
+ assign :page,
+ Overview::OverviewPresenter.new(params: { view: "student" }, school: @school,
+ academic_year: @academic_year)
+ @student_response_rate_presenter = ResponseRatePresenter.new(focus: :student, school: @school,
+ academic_year: @academic_year)
+ @teacher_response_rate_presenter = ResponseRatePresenter.new(focus: :teacher, school: @school,
+ academic_year: @academic_year)
+
+ Respondent.create!(school: @school, academic_year: @academic_year, total_students: 40, total_teachers: 40)
+ 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)
+
+ render
+ end
+ it "shows the view with the students & teachers button active" do
+ expect(subject.css("input[id='student_and_teacher_btn'][checked='checked']").count).to eq 1
+ end
+ end
+
+ context "when the parent view is shown" do
+ let(:variance_chart_row_presenters) do
+ 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)
+ [
+ Overview::VarianceChartRowPresenter.new(measure:,
+ score: Score.new(average: rand))
+ ]
+ end
+
+ before :each do
+ assign :category_presenters, []
+ assign :variance_chart_row_presenters, variance_chart_row_presenters
+ @academic_year = create(:academic_year)
+ assign :academic_years, [@academic_year]
+ @district = create(:district)
+ @school = create(:school)
+ assign :page,
+ Overview::OverviewPresenter.new(params: { view: "parent" }, school: @school,
+ academic_year: @academic_year)
+ @student_response_rate_presenter = ResponseRatePresenter.new(focus: :student, school: @school,
+ academic_year: @academic_year)
+ @teacher_response_rate_presenter = ResponseRatePresenter.new(focus: :teacher, school: @school,
+ academic_year: @academic_year)
+
+ Respondent.create!(school: @school, academic_year: @academic_year, total_students: 40, total_teachers: 40)
+ 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)
+
+ render
+ end
+ it "shows the view with the students & teachers button active" do
+ expect(subject.css("input[id='parent_btn'][checked='checked']").count).to eq 1
+ end
+ end
end
diff --git a/spec/views/overview/variance_chart.html.erb_spec.rb b/spec/views/overview/variance_chart.html.erb_spec.rb
index 81c86b72..a1547fa6 100644
--- a/spec/views/overview/variance_chart.html.erb_spec.rb
+++ b/spec/views/overview/variance_chart.html.erb_spec.rb
@@ -27,8 +27,8 @@ describe "overview/_variance_chart.html.erb" do
before :each do
presenters = [
- VarianceChartRowPresenter.new(measure: lower_scoring_measure, score: Score.new(average: 1)),
- VarianceChartRowPresenter.new(measure: higher_scoring_measure, score: Score.new(average: 5))
+ Overview::VarianceChartRowPresenter.new(measure: lower_scoring_measure, score: Score.new(average: 1)),
+ Overview::VarianceChartRowPresenter.new(measure: higher_scoring_measure, score: Score.new(average: 5))
]
render partial: "variance_chart", locals: { presenters: }
@@ -53,8 +53,8 @@ describe "overview/_variance_chart.html.erb" do
measure_lacking_score = create(:measure)
another_measure_lacking_score = create(:measure)
presenters = [
- VarianceChartRowPresenter.new(measure: measure_lacking_score, score: Score.new(average: nil)),
- VarianceChartRowPresenter.new(measure: another_measure_lacking_score, score: Score.new(average: nil))
+ Overview::VarianceChartRowPresenter.new(measure: measure_lacking_score, score: Score.new(average: nil)),
+ Overview::VarianceChartRowPresenter.new(measure: another_measure_lacking_score, score: Score.new(average: nil))
]
render partial: "variance_chart", locals: { presenters: }