2015-08-18 17:15:46 -04:00
|
|
|
Fabricator(:category) do
|
|
|
|
name { sequence(:name) { |n| "Amazing Category #{n}" } }
|
|
|
|
user
|
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:diff_category, from: :category) do
|
|
|
|
name "Different Category"
|
|
|
|
user
|
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:happy_category, from: :category) do
|
|
|
|
name 'Happy Category'
|
|
|
|
slug 'happy'
|
|
|
|
user
|
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:private_category, from: :category) do
|
|
|
|
transient :group
|
|
|
|
|
|
|
|
name 'Private Category'
|
|
|
|
slug 'private'
|
|
|
|
user
|
|
|
|
after_build do |cat, transients|
|
|
|
|
cat.update!(read_restricted: true)
|
|
|
|
cat.category_groups.build(group_id: transients[:group].id, permission_type: CategoryGroup.permission_types[:full])
|
|
|
|
end
|
|
|
|
end
|
2016-12-05 07:31:43 -05:00
|
|
|
|
|
|
|
Fabricator(:link_category, from: :category) do
|
2016-12-15 17:46:43 -05:00
|
|
|
before_validation { |category, transients| category.topic_featured_link_allowed = true }
|
2016-12-05 07:31:43 -05:00
|
|
|
end
|