From 57af5d6f0d9321c6cafc338990334a8b2de36675 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Wed, 3 Jul 2024 09:46:53 +1000 Subject: [PATCH] FIX: missing flag serializer (#27683) FlagSerializer is using in this PR https://github.com/discourse/discourse/pull/27484 but was not staged. --- app/serializers/flag_serializer.rb | 5 +++++ spec/system/admin_flags_spec.rb | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 app/serializers/flag_serializer.rb diff --git a/app/serializers/flag_serializer.rb b/app/serializers/flag_serializer.rb new file mode 100644 index 00000000000..f5b04dd9e3e --- /dev/null +++ b/app/serializers/flag_serializer.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class FlagSerializer < ApplicationSerializer + attributes :id, :name, :name_key, :description, :applies_to, :position, :enabled +end diff --git a/spec/system/admin_flags_spec.rb b/spec/system/admin_flags_spec.rb index b37ba6bd785..9a1fab04518 100644 --- a/spec/system/admin_flags_spec.rb +++ b/spec/system/admin_flags_spec.rb @@ -75,6 +75,18 @@ describe "Admin Flags Page", type: :system do admin_flag_form_page.fill_in_applies_to("Post") admin_flag_form_page.click_save + expect(all(".admin-flag-item__name").map(&:text)).to eq( + [ + "Send @%{username} a message", + "Off-Topic", + "Inappropriate", + "Spam", + "Illegal", + "Something Else", + "Vulgar", + ], + ) + topic_page.visit_topic(post.topic) topic_page.open_flag_topic_modal expect(all(".flag-action-type-details strong").map(&:text)).to eq(