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

Bugfix: Ensure credit_count is tested correctly #20654

Commits on Feb 19, 2024

  1. Update strong_migrations to version 1.7.0 (forem#20607)

    Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
    Co-authored-by: Mac Siri <mac@forem.com>
    2 people authored and codeandclay committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    f8daf89 View commit details
    Browse the repository at this point in the history
  2. Update redis-actionpack to version 5.4.0 (forem#20648)

    Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
    depfu[bot] authored and codeandclay committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    f46369b View commit details
    Browse the repository at this point in the history
  3. Bugfix: Ensure credit_count is tested correctly

    Fixes forem#20653
    
    Credit uses counter culture to create and populate columns. The code currently populates these columns explicitly. However, not populating the credits_count columns should cause tests to fail. It doesn't.
    
    The credits test subjects are set up with:
    
    ```
    let(:user_credits) { create_list(:credit, 2, user: user) }
    let(:org_credits) { create_list(:credit, 1, organization: organization) }
    ```
    
    However, these are not tested. They do not point to the correct `user` or `organisation`.
    
    Using `let!`, eager loads these associations and creates the necessary credits, and references the lazily loaded `user` and `organization` subjects.
    codeandclay committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    675d6df View commit details
    Browse the repository at this point in the history