Skip to content

Refactor CI workflow and error handling for improved testing - #421

Merged
rsmoke merged 7 commits into
mainfrom
staging
May 7, 2026
Merged

Refactor CI workflow and error handling for improved testing#421
rsmoke merged 7 commits into
mainfrom
staging

Conversation

@rsmoke

@rsmoke rsmoke commented May 7, 2026

Copy link
Copy Markdown
Member

This pull request introduces two main types of changes: (1) standardizing the HTTP status code for unprocessable requests throughout the application from :unprocessable_entity to :unprocessable_content, and (2) adding comprehensive RSpec test coverage for helpers, decorators, policies, models, and controller/request flows. These updates improve both the consistency of error handling and the reliability of the codebase through enhanced testing.

Error handling standardization:

  • Replaced all instances of :unprocessable_entity with :unprocessable_content in controller actions and in the Devise initializer for error responses, ensuring uniform error status handling across the app. [1] [2] [3] [4] [5] [6]

Test suite expansion:

Helper and decorator specs:

  • Added RSpec tests for FlashErrorsHelper, RoomCharacteristicDecorator, RoomDecorator, and SearchHelper, verifying correct mapping, normalization, and formatting behaviors. [1] [2] [3] [4]

Model and policy specs:

  • Added model spec for OmniAuthService, testing associations, scopes, expiration logic, and token handling.
  • Added policy specs for AnnouncementPolicy, ClassroomPolicy, and PagePolicy, ensuring correct authorization logic for different user roles. [1] [2] [3]

Request specs:

  • Added request specs for announcements and pages, covering authentication, authorization, CRUD actions, and layout dependencies. [1] [2]

rsmoke added 7 commits May 7, 2026 15:57
- Enhanced the RSpec command to allow broader test execution while maintaining detailed output options.
- Improved error reporting in room specs for better debugging by extracting relevant lines from the response body during server errors.
- Updated the RSpec command to allow broader test execution while preserving detailed output options.
- Enhanced error reporting in room specs by extracting relevant lines from the response body during server errors for better debugging.
- Updated the RSpec command to broaden test execution capabilities while preserving detailed output options.
- Improved error handling in room specs by extracting relevant lines from the response body during server errors, facilitating better debugging.
- Updated various controllers and the Devise initializer to replace :unprocessable_entity with :unprocessable_content for better clarity in error responses.
- Adjusted corresponding RSpec tests to reflect the change in expected HTTP status codes.
- Simplified the logic in the `stub_group_membership` method to improve readability by using a single line conditional for group checks based on admin status.
@rsmoke
rsmoke merged commit 7ae7d65 into main May 7, 2026
8 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.

1 participant