demarches-normaliennes/spec/mailers/previews/api_token_mailer_preview.rb
2024-01-26 10:18:16 +01:00

23 lines
389 B
Ruby

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