I'm using omniauth-google-oauth2 gem to log in via google account. recently I saw this post https://developers.googleblog.com/2020/08/guidance-for-our-effort-to-block-less-secure-browser-and-apps.html. even though it will not affect to the regular users I'm worried about unit tests. which i guess use headless browsers. so I would like to test that by injecting headers as described in this post(Google-Accounts-Check-OAuth-Login:true
). couldn't find any api methods for that on omiauth documentations.
OmniAuth.config.mock_auth[:google] = OmniAuth::AuthHash.new(
provider: "google",
uid: "123545",
info: {
email: EMAIL,
first_name: FIRST_NAME,
last_name: LAST_NAME,
}
)
visit new_user_registration_path
click_link "Sign in with Google"