From 3b9488cacb4b04c59885ed51d879ade9d92651dc Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Wed, 5 Feb 2020 18:20:39 +1100 Subject: [PATCH] Fix spec for CI --- lib/custom_wizard/builder.rb | 2 +- spec/components/custom_wizard/builder_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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)