Repository navigation
Move the OmniAuth callbacks controller spec into a request spec - #1302
Merged
Merged
Conversation
Provider callbacks are HTTP plumbing with no page of their own, so the seven examples become request specs. OmniAuth's test mode hands the controller the mocked auth hash when the callback path is requested directly, which removes the request.env and reload_routes workarounds the controller spec needed. The behaviour checked is unchanged: first sign-in via Twitter creates the account and identity, existing users are found by identity or by the legacy provider/uid columns, and a signed-in user connecting GitHub is linked, told it is already linked, refused when it belongs to someone else, or sent to the merge page for a legacy account. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spec/controllers/users/omniauth_callbacks_controller_spec.rb(7 examples) becomesspec/requests/omniauth_callbacks_spec.rb. Provider callbacks are HTTP plumbing with no page of their own, so this is the one group that goes to request specs rather than system specs.OmniAuth already runs in test mode for the suite, so requesting a provider's callback path directly hands the controller that provider's mock auth hash. That removes the
request.env['omniauth.auth']andreload_routes_unless_loadedworkarounds the controller spec needed, and thecurrent_userstub.Behaviour covered is unchanged:
Test
Full suite locally: 695 examples, 0 failures.
🤖 Generated with Claude Code