diff --git a/lib/custom_wizard/builder.rb b/lib/custom_wizard/builder.rb index 1dc7dbf6..709cf134 100644 --- a/lib/custom_wizard/builder.rb +++ b/lib/custom_wizard/builder.rb @@ -299,7 +299,7 @@ class CustomWizard::Builder case template['choices_preset'] when 'categories' - objects = site.categories + objects = Set.new(Category.topic_create_allowed(guardian)) when 'groups' objects = site.groups when 'tags' diff --git a/spec/components/custom_wizard/builder_spec.rb b/spec/components/custom_wizard/builder_spec.rb index 8323b4cf..04554037 100644 --- a/spec/components/custom_wizard/builder_spec.rb +++ b/spec/components/custom_wizard/builder_spec.rb @@ -192,6 +192,7 @@ describe CustomWizard::Builder do end it 'returns a preset dropdown' do + SiteSetting.allow_uncategorized_topics = false template['steps'][0]['fields'][0] = dropdown_categories_field choices = build_wizard(template, user).steps[0].fields[0].choices expect(choices.present?).to eq(true)