mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Exclude boston results. Completes #182117456
This commit is contained in:
parent
4634282572
commit
57bfaa51c6
10 changed files with 65 additions and 5 deletions
24
spec/models/survey_item_response_spec.rb
Normal file
24
spec/models/survey_item_response_spec.rb
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
require 'rails_helper'
|
||||
RSpec.describe SurveyItemResponse, type: :model do
|
||||
let(:district) { create(:district) }
|
||||
let(:boston) { create(:district, name: 'Boston') }
|
||||
let(:school) { create(:school, district:) }
|
||||
let(:boston_school) { create(:school, district: boston) }
|
||||
let(:academic_year) { create(:academic_year) }
|
||||
let(:survey_item) { create(:student_survey_item) }
|
||||
|
||||
before :each do
|
||||
create(:survey_item_response, school:, survey_item:)
|
||||
create(:survey_item_response, school: boston_school, survey_item:)
|
||||
end
|
||||
describe '.survey_item_responses' do
|
||||
it 'includes all survey item responses' do
|
||||
expect(survey_item.survey_item_responses.count).to eq 2
|
||||
end
|
||||
end
|
||||
describe '.exclude_boston' do
|
||||
it 'excludes survey item responses from boston schools' do
|
||||
expect(survey_item.survey_item_responses.exclude_boston.count).to eq 1
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue