From d0ebd55b54bb4eb098e1c1028836ef291a4ca19c Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 9 Jun 2025 19:32:56 +0530 Subject: [PATCH] fix: scope --- .../api/v1/accounts/google/authorization_controller_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/controllers/api/v1/accounts/google/authorization_controller_spec.rb b/spec/controllers/api/v1/accounts/google/authorization_controller_spec.rb index b7104108f..ebdf5a140 100644 --- a/spec/controllers/api/v1/accounts/google/authorization_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/google/authorization_controller_spec.rb @@ -39,7 +39,10 @@ RSpec.describe 'Google Authorization API', type: :request do params = CGI.parse(uri.query) expect(url).to start_with('https://accounts.google.com/o/oauth2/auth') - expect(params['scope']).to eq(['email profile https://mail.google.com/']) + expected_scope = 'https://www.googleapis.com/auth/userinfo.profile ' \ + 'https://www.googleapis.com/auth/userinfo.email ' \ + 'https://mail.google.com/' + expect(params['scope']).to eq([expected_scope]) expect(params['redirect_uri']).to eq(["#{ENV.fetch('FRONTEND_URL', 'http://localhost:3000')}/google/callback"]) # Validate state parameter exists and can be decoded back to the account