foodsoft/spec/factories/invite.rb

16 lines
309 B
Ruby
Raw Normal View History

2022-10-05 17:53:10 +02:00
require 'factory_bot'
FactoryBot.define do
factory :invite do
user { create :user }
group { create :group }
email { Faker::Internet.email }
factory :expired_invite do
after :create do |invite|
invite.update_column(:expires_at, Time.now.yesterday)
end
end
end
end