Skip to content

Conversation

@gerardo-navarro
Copy link
Contributor

@gerardo-navarro gerardo-navarro commented Nov 8, 2025

This pull request makes a minor change to the test setup in spec/omniauth/strategies/saml_spec.rb. The helper method post_xml was moved from the global scope into the relevant test context, improving encapsulation and test isolation.

@gerardo-navarro gerardo-navarro changed the title Gerardo navarro refactor saml spec small Refactor helper method #post_xml from the global scope into the relevant test context Nov 9, 2025
@gerardo-navarro gerardo-navarro marked this pull request as ready for review November 9, 2025 22:19
@gerardo-navarro
Copy link
Contributor Author

@fh1ch @bufferoverflow Hi 👋 Here another small refactoring of the tests that applys some ruby testing best practices.

Can you please have a look?

@fh1ch fh1ch requested review from Copilot and fh1ch November 11, 2025 14:16
Copilot finished reviewing on behalf of fh1ch November 11, 2025 14:17
Copy link

Copilot AI left a 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_xml helper method from the top-level scope
  • Introduced let(:xml), let(:params), and subject(: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.

Copy link
Contributor

@fh1ch fh1ch left a 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 👍

@fh1ch fh1ch merged commit ecd23a7 into omniauth:master Nov 11, 2025
11 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.

3 participants