demarches-normaliennes/spec/mailers/previews/api_token_mailer_preview.rb

24 lines
389 B
Ruby
Raw Normal View History

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