scinote-web/spec/factories/projects.rb

25 lines
646 B
Ruby
Raw Normal View History

FactoryBot.define do
2017-07-10 20:38:18 +08:00
factory :project do
2017-07-28 16:14:50 +08:00
created_by { User.first || association(:project_user) }
team { Team.first || association(:project_team) }
2017-07-10 20:38:18 +08:00
archived false
name 'My project'
visibility 'hidden'
end
2017-07-28 16:14:50 +08:00
factory :project_user, class: User do
2017-07-10 20:38:18 +08:00
full_name Faker::Name.name
initials 'AD'
email Faker::Internet.email
password 'asdf1243'
password_confirmation 'asdf1243'
end
2017-07-28 16:14:50 +08:00
factory :project_team, class: Team do
created_by { User.first || association(:project_user) }
2017-07-10 20:38:18 +08:00
name 'My team'
description 'Lorem ipsum dolor sit amet, consectetuer adipiscing eli.'
space_taken 1048576
end
end