Skip to content

[BUG]: Flaky spec - Distributions Double clicking distribution complete does not result in the distribution attemping to be completed twice #5573

@stefannibrasil

Description

@stefannibrasil

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Intermittent failure when running CI:

Failures:

  1) Distributions Double clicking distribution complete does not result in the distribution attemping to be completed twice
     Failure/Error: expect(page).not_to have_content("Sorry, we encountered an error when trying to mark this distribution as being completed")
       expected not to find text "Sorry, we encountered an error when trying to mark this distribution as being completed" in "User Guide\nDiaper McDiaperface\n \nDashboard\n \nDonations\n \nPurchases\n \nRequests\n \nDistributions\n \nPick Ups & Deliveries\n \nPartner Agencies\n \nInventory\n \nCommunity\n \nReports\nSorry, we encountered an error when trying to mark this distribution as being completed\nDistribution from Test Storage Location to Test Partner\n Home\nDistributions\nTest Partner (05/22/2026)\nID\tSource location:\tAgency representative:\tDelivery method:\tShipping cost:\tComments:\tStatus:\n5\tTest Storage Location\t\tDelivery\t\t\tComplete\nItem\tValue per item\tTotal value\tQuantity\tPackage count\n23Dont test this\t\t\t15\t\nTotal:\t\t\t15\t\n Make a Correction  Print\nHuman Essentials was built with  by Ruby for Good.\nVersion:"

     [Screenshot Image]: /home/runner/work/human-essentials/human-essentials/tmp/capybara/failures_r_spec_example_groups_distributions_2_double_clicking_distribution_complete_does_not_result_in_the_distribution_attemping_to_be_completed_twice_712.png


     # ./spec/system/distribution_system_spec.rb:932:in 'block (2 levels) in <top (required)>'

Expected Behavior

No flaky spec for distribution tests

Steps To Reproduce

Action: https://github.com/rubyforgood/human-essentials/actions/runs/26309890703/job/77455758531?pr=5563

To reproduce it, run the tests with the seed number a few times.

Environment

CI

Criteria for Completion

No response

Anything else?

No response

Code of Conduct

  • I've read the Code of Conduct and understand my responsibilities as a member of the Ruby for Good community

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions