2013-02-05 13:16:51 -06:00
|
|
|
Fabricator(:category) do
|
2013-05-07 14:52:45 -05:00
|
|
|
name { sequence(:name) { |n| "Amazing Category #{n}" } }
|
2013-02-05 13:16:51 -06:00
|
|
|
user
|
|
|
|
end
|
2014-10-08 11:44:47 -05:00
|
|
|
|
|
|
|
Fabricator(:diff_category, from: :category) do
|
|
|
|
name "Different Category"
|
|
|
|
user
|
|
|
|
end
|
2014-12-20 08:07:29 -06:00
|
|
|
|
|
|
|
Fabricator(:happy_category, from: :category) do
|
|
|
|
name 'Happy Category'
|
|
|
|
slug 'happy'
|
|
|
|
user
|
|
|
|
end
|
2015-03-02 13:25:25 -06:00
|
|
|
|
|
|
|
Fabricator(:private_category, from: :category) do
|
|
|
|
transient :group
|
|
|
|
|
|
|
|
name 'Private Category'
|
|
|
|
slug 'private'
|
|
|
|
user
|
|
|
|
after_build do |cat, transients|
|
|
|
|
cat.update!(read_restricted: true)
|
2015-04-13 10:48:31 -05:00
|
|
|
cat.category_groups.build(group_id: transients[:group].id, permission_type: CategoryGroup.permission_types[:full])
|
2015-03-02 13:25:25 -06:00
|
|
|
end
|
|
|
|
end
|