Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky partners requests request spec #4870

Merged

Conversation

coalest
Copy link
Collaborator

@coalest coalest commented Dec 19, 2024

Doesn't resolve any issue. But it is one of the specs mentioned in this flaky specs issue.

Description

In the spec we are expecting the family_zipcodes_list to have a certain order but no order is guaranteed in the request. This changes our expectation to match current behavior (order of zip codes doesn't matter).

Example backtrace:


  2) Partners GET #show html when the partner is invited includes impact metrics
     Failure/Error: expect(assigns[:impact_metrics]).to eq(expected_impact_metrics)

       expected: {:children_served=>4, :families_served=>3, :family_zipcodes=>2, :family_zipcodes_list=>["45612-123", "45612-126"]}
            got: {:children_served=>4, :families_served=>3, :family_zipcodes=>2, :family_zipcodes_list=>["45612-126", "45612-123"]}

       (compared using ==)

       Diff:
       @@ -1,5 +1,5 @@
        :children_served => 4,
        :families_served => 3,
        :family_zipcodes => 2,
       -:family_zipcodes_list => ["45612-123", "45612-126"],
       +:family_zipcodes_list => ["45612-126", "45612-123"],

     # ./spec/requests/partners_requests_spec.rb:130:in `block (5 levels) in <top (required)>'

(found in this comment)

Type of change

  • Internal (only related to tests)

How Has This Been Tested?

I wasn't able to reproduce this failure locally. But changing the order of the zipcodes in the setup didn't break the spec so this should in theory fix the issue.

We were expecting the `family_zipcodes_list` to have a certain order
but no order is guaranteed in the request.
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

Neat!

@dorner dorner merged commit a943f81 into rubyforgood:main Dec 19, 2024
11 checks passed
Copy link
Contributor

@coalest: Your PR Fix flaky partners requests request spec is part of today's Human Essentials production release: 2024.12.22.
Thank you very much for your contribution!

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