Skip to content

Refactoring: Moved helpers into GradeEntryFormsController class and added tests for coverage + correctness#7789

Merged
david-yz-liu merged 7 commits into
MarkUsProject:masterfrom
Karl-Michaud:refactor-grade-form
Jan 18, 2026
Merged

Refactoring: Moved helpers into GradeEntryFormsController class and added tests for coverage + correctness#7789
david-yz-liu merged 7 commits into
MarkUsProject:masterfrom
Karl-Michaud:refactor-grade-form

Conversation

@Karl-Michaud

@Karl-Michaud Karl-Michaud commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

This PR includes the following:

1) Refactor

  • Moved helpers from GradeEntryFormsHelper into GradeEntryFormsController, which is the more appropriate and conventional location for this behavior.
  • Deleted the file containing GradeEntryFormsHelper

2) Tests

  • Added controller tests to increase coverage of update_grade_entry_form_params helper (now located in GradeEntryFormsController class).
  • New tests verify:
    • Grade entry items with empty name and out_of fields are deleted during update.
    • Remaining items are assigned sequential position values after deletion, ensuring ordering logic is correct.

See new coverage report:

Screenshot 2026-01-15 at 8 54 26 PM

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) X
🚦 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.
  • I have updated the project documentation, if applicable.
    • This is required for 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.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@Karl-Michaud Karl-Michaud self-assigned this Jan 16, 2026
@coveralls

coveralls commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 21104237473

Details

  • 25 of 25 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 91.611%

Totals Coverage Status
Change from base Build 20703991412: 0.01%
Covered Lines: 44154
Relevant Lines: 47390

💛 - Coveralls

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Karl-Michaud great, I just left a few comments about the test cases you added

Comment thread spec/controllers/grade_entry_forms_controller_spec.rb Outdated
Comment thread spec/controllers/grade_entry_forms_controller_spec.rb Outdated
Comment thread spec/controllers/grade_entry_forms_controller_spec.rb Outdated
Comment thread spec/controllers/grade_entry_forms_controller_spec.rb Outdated

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work, @Karl-Michaud!

@david-yz-liu david-yz-liu merged commit ec80f2c into MarkUsProject:master Jan 18, 2026
7 checks passed
Naragod pushed a commit that referenced this pull request Feb 6, 2026
Also removed old GradeEntryFormsHelper module.
@Naragod Naragod modified the milestone: v2.9.4 Feb 17, 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.

4 participants