-
Notifications
You must be signed in to change notification settings - Fork 209
Refactor helper method #post_xml from the global scope into the relevant test context #244
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
Refactor helper method #post_xml from the global scope into the relevant test context #244
Conversation
Use customizable subject block
…anges-in-describe-block Refactor SAML callback spec helper
…dundant-before-post-callback-response Refine SAML callback specs
|
@fh1ch @bufferoverflow Hi 👋 Here another small refactoring of the tests that applys some ruby testing best practices. Can you please have a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request refactors the test structure in spec/omniauth/strategies/saml_spec.rb by removing the global helper method post_xml and replacing it with a more idiomatic RSpec approach using let statements and a named subject. The refactoring improves test encapsulation and follows RSpec best practices.
Key changes:
- Removed global
post_xmlhelper method from the top-level scope - Introduced
let(:xml),let(:params), andsubject(:post_callback_response)within the test context - Updated all test cases to use the new pattern instead of calling
post_xml
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fh1ch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gerardo-navarro flawless work here, much appreciated 🙇
No findings from my end, so let's get this one in.
LGTM 👍
This pull request makes a minor change to the test setup in
spec/omniauth/strategies/saml_spec.rb. The helper methodpost_xmlwas moved from the global scope into the relevant test context, improving encapsulation and test isolation.