DEV: move post flags into database (#26951)

This is preparation for a feature that will allow admins to define their custom flags. Current behaviour should stay untouched.
This commit is contained in:
Krzysztof Kotlarek
2024-05-21 13:15:32 +10:00
committed by GitHub
parent 34c527d694
commit 7aff9806eb
28 changed files with 346 additions and 83 deletions

View File

@ -1032,7 +1032,7 @@ RSpec.describe DiscourseNarrativeBot::NewUserNarrative do
let(:another_post) { Fabricate(:post, user: discobot_user, topic: topic) }
let(:flag) do
Fabricate(
:flag,
:flag_post_action,
post: post,
user: user,
post_action_type_id: PostActionType.types[:inappropriate],
@ -1040,7 +1040,7 @@ RSpec.describe DiscourseNarrativeBot::NewUserNarrative do
end
let(:other_flag) do
Fabricate(
:flag,
:flag_post_action,
post: another_post,
user: user,
post_action_type_id: PostActionType.types[:spam],
@ -1166,7 +1166,7 @@ RSpec.describe DiscourseNarrativeBot::NewUserNarrative do
describe "when post contain the right answer" do
let(:post) { Fabricate(:post, user: discobot_user, topic: topic) }
let(:flag) { Fabricate(:flag, post: post, user: user) }
let(:flag) { Fabricate(:flag_post_action, post: post, user: user) }
before do
narrative.set_data(user, state: :tutorial_flag, topic_id: topic.id)