Completes Sub Categories and Measures for "All " Category Tabs -

Milford High School (Milford District).  Add tabs to top navigation [#179727241]
This commit is contained in:
Liam Morley 2021-10-07 17:07:39 -04:00 committed by rebuilt
parent 5595af15b6
commit a406205e20
16 changed files with 106 additions and 17 deletions

View file

@ -1,7 +1,25 @@
FactoryBot.define do
factory :district do
name { "#{rand} District" }
slug { name.parameterize }
end
factory :school do
name { "#{rand} School" }
slug { name.parameterize }
district
end
factory :academic_year do
range { '2050-51' }
end
factory :sqm_category do
name { "A category" }
description { "A description of a category" }
slug { 'a-category' }
sort_index { 1 }
end
factory :subcategory do
@ -34,14 +52,6 @@ FactoryBot.define do
measure
end
factory :academic_year do
range { '2050-51' }
end
factory :school do
name { "#{rand} School" }
end
factory :survey_item_response do
likert_score { 3 }
response_id { rand.to_s }

View file

@ -104,6 +104,9 @@ feature 'School dashboard', type: feature do
expect(page).to have_text('Teachers & Leadership')
expect(page).to have_text('Approval')
click_on 'School Culture'
expect(page).to have_text('This category measures the degree to which the school environment is safe, caring, and academically-oriented.')
end
scenario 'user sees schools in the same district' do

View file

@ -6,6 +6,7 @@ describe 'sqm_categories/show.html.erb' do
school = create(:school, name: 'Best School')
category = create(:sqm_category, name: 'Some Category', description: 'Some description of the category')
category_presenter = CategoryPresenter.new(category: category, academic_year: academic_year, school: school)
subcategory1 = create(:subcategory, sqm_category: category, name: 'A subcategory', description: 'Some description of the subcategory')
subcategory2 = create(:subcategory_with_measures, sqm_category: category, name: 'Another subcategory', description: 'Another description of the subcategory')
@ -18,7 +19,12 @@ describe 'sqm_categories/show.html.erb' do
survey_item2 = create(:survey_item, measure: measure2)
create(:survey_item_response, survey_item: survey_item2, academic_year: academic_year, school: school, likert_score: 5)
assign :category, CategoryPresenter.new(category: category, academic_year: academic_year, school: school)
assign :category, category_presenter
assign :categories, [category_presenter]
assign :school, school
assign :district, create(:district)
assign :academic_year, academic_year
render
end