Skip to content

Cover US path deterministically - #731

Closed
abcampo-iry wants to merge 1 commit into
mainfrom
issue-1225-flaky-bug-nces
Closed

Cover US path deterministically#731
abcampo-iry wants to merge 1 commit into
mainfrom
issue-1225-flaky-bug-nces

Conversation

@abcampo-iry

Copy link
Copy Markdown
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:23
@cla-bot

cla-bot Bot commented Mar 13, 2026

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown

Test coverage

90.06% line coverage reported by SimpleCov.
Run: https://github.com/RaspberryPiFoundation/editor-api/actions/runs/23048616546

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates test seeding to reliably exercise the US-specific school validation path and aligns seeded US district IDs with the model’s expected format.

Changes:

  • Add a seed_country_code hook in the task spec to optionally stub Faker::Address.country_code, plus a US-specific context/assertions.
  • Change US district_nces_id seed generation from 12 digits to 7 digits to match validation expectations.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
spec/lib/test_seeds_spec.rb Adds a US-only context and stubbing mechanism to exercise US seeding behavior.
lib/tasks/seeds_helper.rb Adjusts US district NCES ID generation to a 7-digit format.

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

Comment on lines +39 to +42
let(:seed_country_code) { nil }

before do
allow(Faker::Address).to receive(:country_code).and_return(seed_country_code) if seed_country_code
@abcampo-iry

Copy link
Copy Markdown
Contributor Author

Found issue with CLA

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