2023-08-10 21:01:45 +12:00
|
|
|
defmodule Support.Factory do
|
|
|
|
@moduledoc false
|
|
|
|
|
|
|
|
use Smokestack
|
|
|
|
|
|
|
|
factory Support.Author do
|
|
|
|
attribute :name, &Faker.Person.name/0
|
|
|
|
attribute :email, &Faker.Internet.email/0
|
|
|
|
end
|
|
|
|
|
|
|
|
factory Support.Author, :trek do
|
2024-03-28 10:04:54 +13:00
|
|
|
attribute :name, choose(["JL", "Dr Mark", "BLT", "Cal Hudson"])
|
2023-08-10 21:01:45 +12:00
|
|
|
|
|
|
|
attribute :email, fn
|
|
|
|
%{name: "JL"} -> "captain@entrepreneur.starfleet"
|
2024-05-28 16:38:53 +12:00
|
|
|
%{name: "Dr Mark"} -> "cheifmed@voyager.starfleet"
|
2023-08-10 21:01:45 +12:00
|
|
|
%{name: "BLT"} -> "cheifeng@voyager.starfleet"
|
2024-05-28 16:38:53 +12:00
|
|
|
%{name: "Cal Hudson"} -> "cal@maquis.rebellion"
|
2023-08-10 21:01:45 +12:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
factory Support.Post do
|
2024-03-28 10:04:54 +13:00
|
|
|
domain Support.Domain
|
2023-09-05 19:37:00 +12:00
|
|
|
|
2023-08-10 21:01:45 +12:00
|
|
|
attribute :title, &Faker.Commerce.product_name/0
|
|
|
|
attribute :tags, n_times(3..20, &Faker.Lorem.word/0)
|
|
|
|
attribute :body, &Faker.Markdown.markdown/0
|
2023-08-17 20:19:40 +12:00
|
|
|
attribute :sub_title, &Faker.Lorem.sentence/0
|
2023-08-10 21:01:45 +12:00
|
|
|
end
|
|
|
|
|
|
|
|
factory Support.Post, :trek do
|
|
|
|
attribute :title,
|
|
|
|
choose([
|
|
|
|
"On the safety of conference attendance",
|
|
|
|
"Who would win? Q vs Kevin Uxbridge - an analysis",
|
|
|
|
"Improvised tools for warp core maintenance",
|
|
|
|
"Cardassia Prime: Hot or Not?"
|
|
|
|
])
|
|
|
|
|
|
|
|
attribute :body, &Faker.Markdown.markdown/0
|
|
|
|
end
|
|
|
|
end
|