mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
DEV: Add test to ensure :after_auth event is triggered (#8400)
Follow-up to ee8669d778ad46cb65265042eac4c58e9af0bf16.
This commit is contained in:
@ -195,7 +195,8 @@ RSpec.describe Users::OmniauthCallbacksController do
|
||||
destination_url = '/somepath'
|
||||
Rails.application.env_config["omniauth.origin"] = destination_url
|
||||
|
||||
get "/auth/google_oauth2/callback.json"
|
||||
events = DiscourseEvent.track_events { get "/auth/google_oauth2/callback.json" }
|
||||
expect(events.any? { |e| e[:event_name] === :after_auth && Auth::GoogleOAuth2Authenticator === e[:params][0] && !e[:params][1].failed? }).to eq(true)
|
||||
|
||||
expect(response.status).to eq(302)
|
||||
|
||||
|
Reference in New Issue
Block a user