chore: Refactor RefreshOauthTokenService to improve readability (#8820)
- Added a trait called microsoft_email for the Channel::Email factory. - Rewrote the logic to make it simple to understand - Rewrote the specs for readability
This commit is contained in:
@@ -8,5 +8,22 @@ FactoryBot.define do
|
||||
after(:create) do |channel_email|
|
||||
create(:inbox, channel: channel_email, account: channel_email.account)
|
||||
end
|
||||
|
||||
trait :microsoft_email do
|
||||
imap_enabled { true }
|
||||
imap_address { 'outlook.office365.com' }
|
||||
imap_port { 993 }
|
||||
imap_login { 'email@example.com' }
|
||||
imap_password { '' }
|
||||
imap_enable_ssl { true }
|
||||
provider_config do
|
||||
{
|
||||
expires_on: Time.zone.now + 3600,
|
||||
access_token: SecureRandom.hex,
|
||||
refresh_token: SecureRandom.hex
|
||||
}
|
||||
end
|
||||
provider { 'microsoft' }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user