2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-01-23 17:21:30 +01:00
|
|
|
class APITokenMailerPreview < ActionMailer::Preview
|
|
|
|
def expiration
|
|
|
|
APITokenMailer.expiration(api_token)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def api_token
|
|
|
|
APIToken.new(
|
|
|
|
administrateur: administrateur,
|
|
|
|
expires_at: 1.week.from_now,
|
|
|
|
name: 'My API token'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
def administrateur
|
|
|
|
Administrateur.new(user:)
|
|
|
|
end
|
|
|
|
|
|
|
|
def user
|
|
|
|
User.new(email: 'admin@a.com')
|
|
|
|
end
|
|
|
|
end
|