mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
Add tests to user model and admin panel requests
This commit is contained in:
@@ -5,4 +5,20 @@ FactoryBot.define do
|
||||
full_name { "First Last" }
|
||||
password { "password" }
|
||||
end
|
||||
|
||||
factory :moderator, class: User do
|
||||
sequence(:email) { |n| "mod#{n}@example.com" }
|
||||
|
||||
full_name { "First Last" }
|
||||
password { "password" }
|
||||
role { "moderator" }
|
||||
end
|
||||
|
||||
factory :admin, class: User do
|
||||
sequence(:email) { |n| "admin#{n}@example.com" }
|
||||
|
||||
full_name { "First Last" }
|
||||
password { "password" }
|
||||
role { "admin" }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user