2019-07-25 01:11:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-13 19:13:44 -05:00
|
|
|
FactoryBot.define do
|
2016-02-16 22:55:24 -05:00
|
|
|
factory :project_member do
|
|
|
|
user
|
2017-08-02 15:55:11 -04:00
|
|
|
project
|
2018-07-11 10:36:08 -04:00
|
|
|
maintainer
|
2016-03-06 16:53:22 -05:00
|
|
|
|
2019-10-01 20:06:26 -04:00
|
|
|
trait(:guest) { access_level { ProjectMember::GUEST } }
|
|
|
|
trait(:reporter) { access_level { ProjectMember::REPORTER } }
|
|
|
|
trait(:developer) { access_level { ProjectMember::DEVELOPER } }
|
|
|
|
trait(:maintainer) { access_level { ProjectMember::MAINTAINER } }
|
2018-09-20 13:02:36 -04:00
|
|
|
trait(:access_request) { requested_at { Time.now } }
|
2017-05-18 09:18:26 -04:00
|
|
|
|
|
|
|
trait(:invited) do
|
2019-10-01 20:06:26 -04:00
|
|
|
user_id { nil }
|
|
|
|
invite_token { 'xxx' }
|
|
|
|
invite_email { 'email@email.com' }
|
2017-05-18 09:18:26 -04:00
|
|
|
end
|
2019-08-30 17:30:51 -04:00
|
|
|
|
|
|
|
trait :blocked do
|
|
|
|
after(:build) { |project_member, _| project_member.user.block! }
|
|
|
|
end
|
2016-02-16 22:55:24 -05:00
|
|
|
end
|
|
|
|
end
|