21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-05-19 17:08:38 +02:00
chexpire/test/factories/notifications.rb

42 lines
1.1 KiB
Ruby
Raw Normal View History

# 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)
2018-05-31 20:49:06 +02:00
# == Schema Information
#
# Table name: notifications
#
# id :bigint(8) not null, primary key
# channel :integer default("email"), not null
# checks_count :integer default(0), not null
# interval :integer not null
# label :string(255)
# recipient :string(255) not null
# created_at :datetime not null
# updated_at :datetime not null
# check_id :bigint(8)
# user_id :bigint(8)
2018-05-31 20:49:06 +02:00
#
# Indexes
#
# index_notifications_on_check_id (check_id)
# index_notifications_on_user_id (user_id)
2018-05-31 20:49:06 +02:00
#
# Foreign Keys
#
# fk_rails_... (check_id => checks.id)
# fk_rails_... (user_id => users.id)
2018-05-31 20:49:06 +02:00
#
2018-06-02 14:45:15 +02:00
FactoryBot.define do
factory :notification do
user
interval { 30 }
channel { :email }
2019-03-02 11:01:33 +01:00
sequence(:label) { |n| "#{recipient}-#{n} (#{interval})" }
recipient { "recipient@domain.fr" }
2018-05-31 20:49:06 +02:00
2018-06-02 14:45:15 +02:00
trait :email do
channel { :email }
2018-06-02 14:45:15 +02:00
end
end
end