mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 12:55:59 +08:00
e7cbf15040
1) Edit Category when editing a category with form templates set should have form templates enabled and showing the selected templates Failure/Error: expect(category_page).to have_selected_template(selected_templates) expected `#<PageObjects::Pages::Category:0x00007fdb278fbd30>.has_selected_template?("template_0,template_1")` to be truthy, got false Wait for CSS rather than trying to compare attr directly and also make sure the ids are always in order.
40 lines
808 B
Ruby
40 lines
808 B
Ruby
# frozen_string_literal: true
|
|
|
|
class SiteCategorySerializer < BasicCategorySerializer
|
|
attributes :allowed_tags,
|
|
:allowed_tag_groups,
|
|
:allow_global_tags,
|
|
:read_only_banner,
|
|
:form_template_ids
|
|
|
|
has_many :category_required_tag_groups, key: :required_tag_groups, embed: :objects
|
|
|
|
def form_template_ids
|
|
object.form_template_ids.sort
|
|
end
|
|
|
|
def include_allowed_tags?
|
|
SiteSetting.tagging_enabled
|
|
end
|
|
|
|
def allowed_tags
|
|
object.tags.pluck(:name)
|
|
end
|
|
|
|
def include_allowed_tag_groups?
|
|
SiteSetting.tagging_enabled
|
|
end
|
|
|
|
def allowed_tag_groups
|
|
object.tag_groups.pluck(:name)
|
|
end
|
|
|
|
def include_allow_global_tags?
|
|
SiteSetting.tagging_enabled
|
|
end
|
|
|
|
def include_required_tag_groups?
|
|
SiteSetting.tagging_enabled
|
|
end
|
|
end
|