Skip to content

Test/global actions#7955

Merged
david-yz-liu merged 13 commits into
MarkUsProject:masterfrom
akarki2005:test/global-actions
May 20, 2026
Merged

Test/global actions#7955
david-yz-liu merged 13 commits into
MarkUsProject:masterfrom
akarki2005:test/global-actions

Conversation

@akarki2005
Copy link
Copy Markdown
Contributor

@akarki2005 akarki2005 commented May 17, 2026

Proposed Changes

This PR adds missing test coverage for three private helper methods called through GroupsController#global_actions:

  1. check_for_groupings: raises when no groupings are selected
  2. add_members: raises when 2+ groupings are selected, no students are selected, or group_max would be exceeded
  3. add_member: sets :inviter status when grouping is empty, raises when student is already grouped, raises when student cannot be invited (different course), and flashes error when student has insufficient grace credits

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests) X
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have updated the project Changelog (this is required for all changes).
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Copy link
Copy Markdown
Collaborator

@david-yz-liu david-yz-liu left a comment

Choose a reason for hiding this comment

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

@akarki2005 in addition to the inline comments I left, I see that the pre-commit bot made some updates to your branch. This indicates that you haven't set up the pre-commit hooks properly in your local repository, so please make sure to do so before making another commit.

Comment thread spec/controllers/groups_controller_spec.rb Outdated
Comment thread spec/controllers/groups_controller_spec.rb Outdated
Comment thread spec/controllers/groups_controller_spec.rb Outdated
Comment thread spec/controllers/groups_controller_spec.rb Outdated
@akarki2005 akarki2005 force-pushed the test/global-actions branch from 543b2e7 to 4eb7fd0 Compare May 19, 2026 00:14
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented May 19, 2026

Coverage Report for CI Build 26184493151

Coverage increased (+0.03%) to 90.209%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: 40 of 40 lines across 2 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 49672
Covered Lines: 45778
Line Coverage: 92.16%
Relevant Branches: 2151
Covered Branches: 971
Branch Coverage: 45.14%
Branches in Coverage %: Yes
Coverage Strength: 128.13 hits per line

💛 - Coveralls

@akarki2005 akarki2005 requested a review from david-yz-liu May 19, 2026 01:14
Comment thread spec/controllers/groups_controller_spec.rb Outdated
@akarki2005 akarki2005 requested a review from david-yz-liu May 20, 2026 19:48
Copy link
Copy Markdown
Collaborator

@david-yz-liu david-yz-liu left a comment

Choose a reason for hiding this comment

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

Nice work, @akarki2005!

@david-yz-liu david-yz-liu merged commit 8ad45f4 into MarkUsProject:master May 20, 2026
7 checks passed
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.

5 participants