]> git.openstreetmap.org Git - rails.git/blob - test/factories/user_blocks.rb
Convert dashboard test into a system test
[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     deactivates_at { ends_at }
6
7     user
8     creator :factory => :moderator_user
9
10     trait :needs_view do
11       needs_view { true }
12       deactivates_at { nil }
13     end
14
15     trait :expired do
16       created_at { Time.now.utc - 2.days }
17       ends_at { Time.now.utc - 1.day }
18     end
19
20     trait :revoked do
21       expired
22       revoker :factory => :moderator_user
23     end
24   end
25 end