21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-05-13 22:18:38 +02:00
chexpire/test/factories/notifications.rb
2018-08-02 00:29:53 +02:00

54 lines
1.1 KiB
Ruby

# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Jeremy Lecour <jlecour@evolix.fr>, 2018 Evolix <info@evolix.fr>
# License: GNU AGPL-3+ (see full text in LICENSE file)
# == Schema Information
#
# Table name: notifications
#
# id :bigint(8) not null, primary key
# channel :integer default("email"), not null
# interval :integer not null
# recipient :string(255) not null
# sent_at :datetime
# status :integer default("pending"), not null
# created_at :datetime not null
# updated_at :datetime not null
# check_id :bigint(8)
#
# Indexes
#
# index_notifications_on_check_id (check_id)
#
# Foreign Keys
#
# fk_rails_... (check_id => checks.id)
#
FactoryBot.define do
factory :notification do
check
interval 30
channel :email
recipient "recipient@domain.fr"
status :pending
sent_at nil
trait :email do
channel :email
end
trait :ongoing do
status :ongoing
end
trait :succeed do
status :succeed
sent_at { 1.day.ago }
end
trait :failed do
status :failed
end
end
end