2018-05-31 20:49:06 +02:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: notifications
|
|
|
|
#
|
|
|
|
# id :bigint(8) not null, primary key
|
2018-06-04 20:39:53 +02:00
|
|
|
# channel :integer default("email"), not null
|
2018-05-31 20:49:06 +02:00
|
|
|
# delay :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)
|
|
|
|
#
|
|
|
|
|
2018-06-02 14:45:15 +02:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :notification do
|
|
|
|
check
|
|
|
|
delay 30
|
|
|
|
channel :email
|
|
|
|
recipient "recipient@domain.fr"
|
|
|
|
status :pending
|
|
|
|
sent_at nil
|
2018-05-31 20:49:06 +02:00
|
|
|
|
2018-06-02 14:45:15 +02:00
|
|
|
trait :email do
|
|
|
|
channel :email
|
|
|
|
end
|
2018-05-31 20:49:06 +02:00
|
|
|
|
2018-06-02 14:45:15 +02:00
|
|
|
trait :ongoing do
|
|
|
|
status :ongoing
|
|
|
|
end
|
|
|
|
|
|
|
|
trait :succeed do
|
|
|
|
status :succeed
|
2018-06-04 14:06:37 +02:00
|
|
|
sent_at { 1.day.ago }
|
2018-06-02 14:45:15 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :failed do
|
|
|
|
status :failed
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|