Cross Reference: team_factory.rb
xref
: /
ontohub
/
spec
/
factories
/
team_factory.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
FactoryGirl.define
do
factory
:
team
do
name
{
Faker
::
Lorem.words
(
2
)
.
join
(
" "
)
}
factory
:
team_with_user_and_permission
do
|
team
|
team.after
(:
build
)
do
|
team
|
user
=
FactoryGirl.create
(:
user
,
teams
: [
team
])
permission
=
FactoryGirl.create
(:
permission
,
subject
:
team
,
role
:
'editor'
)
team.permissions
<< permission
end
end
end
factory :team_user do
association :team
association :user
end
end