demarches-normaliennes/spec/mailers/previews/api_token_mailer_preview.rb
2024-08-22 09:26:48 +02:00

25 lines
420 B
Ruby

# frozen_string_literal: true
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