2019-04-29 20:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-08-14 13:11:30 -04:00
|
|
|
require "faker"
|
|
|
|
|
2019-01-03 12:03:01 -05:00
|
|
|
Fabricator(:reviewable) do
|
|
|
|
reviewable_by_moderator true
|
|
|
|
type "ReviewableUser"
|
|
|
|
created_by { Fabricate(:user) }
|
|
|
|
target_id { Fabricate(:user).id }
|
|
|
|
target_type "User"
|
|
|
|
target_created_by { Fabricate(:user) }
|
|
|
|
category
|
|
|
|
score 1.23
|
|
|
|
payload { { list: [1, 2, 3], name: "bandersnatch" } }
|
2023-11-19 18:50:09 -05:00
|
|
|
status { :pending }
|
2019-01-03 12:03:01 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:reviewable_queued_post_topic, class_name: :reviewable_queued_post) do
|
|
|
|
reviewable_by_moderator true
|
|
|
|
type "ReviewableQueuedPost"
|
|
|
|
created_by { Fabricate(:user) }
|
2023-07-18 07:50:31 -04:00
|
|
|
target_created_by { Fabricate(:user) }
|
2019-01-03 12:03:01 -05:00
|
|
|
category
|
|
|
|
payload do
|
|
|
|
{
|
|
|
|
raw: "hello world post contents.",
|
|
|
|
title: "queued post title",
|
|
|
|
tags: %w[cool neat],
|
|
|
|
extra: "some extra data",
|
|
|
|
archetype: "regular",
|
|
|
|
}
|
2023-01-09 06:18:21 -05:00
|
|
|
end
|
2019-01-03 12:03:01 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
Fabricator(:reviewable_queued_post) do
|
|
|
|
reviewable_by_moderator true
|
|
|
|
type "ReviewableQueuedPost"
|
|
|
|
created_by { Fabricate(:user) }
|
2023-07-18 07:50:31 -04:00
|
|
|
target_created_by { Fabricate(:user) }
|
2019-01-03 12:03:01 -05:00
|
|
|
topic
|
|
|
|
payload do
|
|
|
|
{
|
|
|
|
raw: "hello world post contents.",
|
|
|
|
reply_to_post_number: 1,
|
|
|
|
via_email: true,
|
|
|
|
raw_email: "store_me",
|
|
|
|
auto_track: true,
|
|
|
|
custom_fields: {
|
|
|
|
hello: "world",
|
|
|
|
},
|
|
|
|
cooking_options: {
|
|
|
|
cat: "hat",
|
2023-01-09 06:18:21 -05:00
|
|
|
},
|
2019-01-03 12:03:01 -05:00
|
|
|
cook_method: Post.cook_methods[:raw_html],
|
|
|
|
image_sizes: {
|
|
|
|
"http://foo.bar/image.png" => {
|
|
|
|
"width" => 0,
|
|
|
|
"height" => 222,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2023-01-09 06:18:21 -05:00
|
|
|
end
|
2019-01-03 12:03:01 -05:00
|
|
|
end
|
|
|
|
|
2023-08-14 13:11:30 -04:00
|
|
|
Fabricator(:reviewable_queued_long_post, from: :reviewable_queued_post) do
|
|
|
|
reviewable_by_moderator true
|
|
|
|
type "ReviewableQueuedPost"
|
|
|
|
created_by { Fabricate(:user) }
|
|
|
|
target_created_by { Fabricate(:user) }
|
|
|
|
topic
|
|
|
|
payload do
|
|
|
|
{
|
|
|
|
raw: Faker::DiscourseMarkdown.sandwich(sentences: 6, repeat: 3),
|
|
|
|
reply_to_post_number: 1,
|
|
|
|
via_email: true,
|
|
|
|
raw_email: "store_me",
|
|
|
|
auto_track: true,
|
|
|
|
custom_fields: {
|
|
|
|
hello: "world",
|
|
|
|
},
|
|
|
|
cooking_options: {
|
|
|
|
cat: "hat",
|
|
|
|
},
|
|
|
|
cook_method: Post.cook_methods[:raw_html],
|
|
|
|
image_sizes: {
|
|
|
|
"http://foo.bar/image.png" => {
|
|
|
|
"width" => 0,
|
|
|
|
"height" => 222,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-01-03 12:03:01 -05:00
|
|
|
Fabricator(:reviewable_flagged_post) do
|
|
|
|
reviewable_by_moderator true
|
|
|
|
type "ReviewableFlaggedPost"
|
|
|
|
created_by { Fabricate(:user) }
|
2024-09-30 01:27:25 -04:00
|
|
|
target_created_by { Fabricate(:user) }
|
2019-01-03 12:03:01 -05:00
|
|
|
topic
|
|
|
|
target_type "Post"
|
|
|
|
target { Fabricate(:post) }
|
2021-11-24 10:28:20 -05:00
|
|
|
reviewable_scores { |p| [Fabricate.build(:reviewable_score, reviewable_id: p[:id])] }
|
2019-01-03 12:03:01 -05:00
|
|
|
end
|
2019-12-12 14:26:38 -05:00
|
|
|
|
|
|
|
Fabricator(:reviewable_user) do
|
|
|
|
reviewable_by_moderator true
|
|
|
|
type "ReviewableUser"
|
|
|
|
created_by { Fabricate(:user) }
|
|
|
|
target_type "User"
|
|
|
|
target { Fabricate(:user) }
|
|
|
|
end
|