Skip to content

Cover US path deterministically#730

Closed
abcampo-iry wants to merge 1 commit intomainfrom
issues/1225-flaky-bug-seeding-nces-id
Closed

Cover US path deterministically#730
abcampo-iry wants to merge 1 commit intomainfrom
issues/1225-flaky-bug-seeding-nces-id

Conversation

@abcampo-iry
Copy link
Contributor

No description provided.

- district_nces_id now generates 7 digits instead of 12
- we were using school id instead
Copilot AI review requested due to automatic review settings March 13, 2026 11:12
@cla-bot
Copy link

cla-bot bot commented Mar 13, 2026

We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please complete this form and we'll get you added and review your contribution as soon as possible.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes US-specific school seeding deterministic and valid by aligning generated district_nces_id with the model’s 7-digit validation and adding a targeted spec to cover the US branch.

Changes:

  • Generate a 7-digit district_nces_id when seeding US schools to satisfy model validation.
  • Add an RSpec context that stubs Faker::Address.country_code to US and asserts required US district fields are populated.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
spec/lib/test_seeds_spec.rb Adds deterministic US-country seeding coverage and asserts district fields + owner lessons are created correctly.
lib/tasks/seeds_helper.rb Fixes US district_nces_id generation to a 7-digit string to match School validations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Test coverage

SimpleCov coverage data was unavailable for this run.
Run: https://github.com/RaspberryPiFoundation/editor-api/actions/runs/23048248605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants