1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/factories/sessions.rb

26 lines
572 B
Ruby
Raw Normal View History

2019-09-03 09:43:24 -04:00
# frozen_string_literal: true
FactoryBot.define do
factory :some_session, class: Session do
association :account, factory: :usual_account
2019-09-03 10:01:00 -04:00
logged_at { Faker::Time.backward.utc }
2019-09-03 09:43:24 -04:00
ip_address { Faker::Internet.ip_v4_address }
2019-09-10 00:35:23 -04:00
user_agent { Faker::Internet.user_agent }
2019-09-03 09:43:24 -04:00
trait :with_ipv6_address do
ip_address { Faker::Internet.ip_v6_address }
end
2019-09-29 09:23:06 -04:00
trait :without_user_agent do
user_agent { nil }
end
2019-09-03 09:43:24 -04:00
end
2019-09-04 16:54:23 -04:00
factory :some_session_with_ipv6_address,
2019-09-03 09:43:24 -04:00
parent: :some_session,
traits: %i[with_ipv6_address]
end