Discourse Custom Wizard main does not work on tests-passed

Discourse Custom Wizard either has a bug, or is incompatible with the Discourse commit linked below.

Time: 2023-12-19T00:12:20+00:00
Message: ci / backend_tests has failed: Process completed with exit code 1.

Discourse

Branch: tests-passed
SHA:

Plugin

Branch: main
SHA:

Details

  1) Topic with a create_topic_wizard custom field in the category will not allow creating a topic directly
     Failure/Error:
       expect do
         TopicCreator.create(
           user,
           Guardian.new(user),
           valid_attrs.merge(
             title: 'A valid and sufficiently long title for testing',
             category: category_with_wizard.id,
             raw: 'hello this is a test topic with category with custom fields'
           )
         )
     
       expected Discourse::InvalidParameters with "Category not allowed for topic creation.", got #<Discourse::InvalidAccess: can_create? failed> with backtrace:
         # ./lib/guardian/ensure_magic.rb:11:in `method_missing'
         # ./lib/topic_creator.rb:143:in `setup_topic_params'
         # ./lib/topic_creator.rb:45:in `create'
         # ./lib/topic_creator.rb:9:in `create'
         # ./plugins/discourse-custom-wizard/spec/extensions/topic_extension_spec.rb:14:in `block (4 levels) in <main>'
         # ./plugins/discourse-custom-wizard/spec/extensions/topic_extension_spec.rb:13:in `block (3 levels) in <main>'
         # ./spec/rails_helper.rb:491:in `block (3 levels) in <top (required)>'
         # ./spec/rails_helper.rb:486:in `block (2 levels) in <top (required)>'
         # ./spec/rails_helper.rb:475:in `block (2 levels) in <top (required)>'
     # ./plugins/discourse-custom-wizard/spec/extensions/topic_extension_spec.rb:13:in `block (3 levels) in <main>'
     # ./spec/rails_helper.rb:491:in `block (3 levels) in <top (required)>'
     # ./spec/rails_helper.rb:486:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:475:in `block (2 levels) in <top (required)>'

  2) Topic without a create_topic_wizard custom field in the category will allow creating a topic directly
     Failure/Error:
       expect do
         TopicCreator.create(
           user,
           Guardian.new(user),
           valid_attrs.merge(
             category: category_without_wizard.id,
             title: 'Another valid and sufficiently long title for testing',
             raw: 'This is the body of a valid topic'
           )
         )
     
       expected no Exception, got #<Discourse::InvalidAccess: can_create? failed> with backtrace:
         # ./lib/guardian/ensure_magic.rb:11:in `method_missing'
         # ./lib/topic_creator.rb:143:in `setup_topic_params'
         # ./lib/topic_creator.rb:45:in `create'
         # ./lib/topic_creator.rb:9:in `create'
         # ./plugins/discourse-custom-wizard/spec/extensions/topic_extension_spec.rb:33:in `block (4 levels) in <main>'
         # ./plugins/discourse-custom-wizard/spec/extensions/topic_extension_spec.rb:32:in `block (3 levels) in <main>'
         # ./spec/rails_helper.rb:491:in `block (3 levels) in <top (required)>'
         # ./spec/rails_helper.rb:486:in `block (2 levels) in <top (required)>'
         # ./spec/rails_helper.rb:475:in `block (2 levels) in <top (required)>'
     # ./plugins/discourse-custom-wizard/spec/extensions/topic_extension_spec.rb:32:in `block (3 levels) in <main>'
     # ./spec/rails_helper.rb:491:in `block (3 levels) in <top (required)>'
     # ./spec/rails_helper.rb:486:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:475:in `block (2 levels) in <top (required)>'

I expect this to be related to this commit and this change .

1 Like

Discourse Custom Wizard has recovered from this issue.

1 Like