]> git.openstreetmap.org Git - rails.git/blob - test/factories/user_blocks.rb
Merge remote-tracking branch 'upstream/pull/5096'
[rails.git] / test / factories / user_blocks.rb
1 FactoryBot.define do
2   factory :user_block do
3     sequence(:reason) { |n| "User Block #{n}" }
4     ends_at { Time.now.utc + 1.day }
5
6     user
7     creator :factory => :moderator_user
8
9     trait :needs_view do
10       needs_view { true }
11     end
12
13     trait :expired do
14       created_at { Time.now.utc - 2.days }
15       ends_at { Time.now.utc - 1.day }
16     end
17
18     trait :revoked do
19       expired
20       revoker :factory => :moderator_user
21     end
22   end
23 end