Skip to content

Fix flaky system specs for account request and partner group editing - #5653

Open
rodrigovirgilio wants to merge 1 commit into
rubyforgood:mainfrom
rodrigovirgilio:fix/flaky-system-tests
Open

Fix flaky system specs for account request and partner group editing#5653
rodrigovirgilio wants to merge 1 commit into
rubyforgood:mainfrom
rodrigovirgilio:fix/flaky-system-tests

Conversation

@rodrigovirgilio

@rodrigovirgilio rodrigovirgilio commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes two intermittently failing system specs that caused the rspec-system workflow to fail on CI.

spec/system/account_request_system_spec.rb
The test asserted expect { click_button "Submit" }.to change(AccountRequest, :count).by(1), but the count was read before the async form submission had been processed by the server, so the change was reported as 0. The assertion now clicks the button, waits for the redirect (Request Received!), and only then asserts the record count.

spec/system/partner_system_spec.rb (partner group "deadline and reminder form" shared examples)
click_on "Edit" could run before the Groups tab-pane was actually displayed, raising Capybara::ElementNotFound. The preceding has_content? check was a false positive because the group name also appears in the (visible) Partners tab. The wait and click are now scoped with within "#nav-partner-groups", so the test waits for the tab to be shown before interacting with it.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • bundle exec rspec spec/system/account_request_system_spec.rb → 4 examples, 0 failures (repeated runs)
  • bundle exec rspec spec/system/partner_system_spec.rb → 47 examples, 0 failures
  • bundle exec rubocop spec/system/account_request_system_spec.rb spec/system/partner_system_spec.rb → no offenses

@rodrigovirgilio rodrigovirgilio changed the title Fix flaky system tests (account request & partner group editing) Fix flaky system specs for account request and partner group editing Aug 8, 2026
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.

1 participant