From 6294f6f9c0744e8f1fe31c2edb1ce8a0240c4dae Mon Sep 17 00:00:00 2001 From: jumagura Date: Mon, 2 Oct 2023 22:44:54 -0400 Subject: [PATCH] DEV: Add correct parameters for testing --- spec/extensions/topic_extension_spec.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/spec/extensions/topic_extension_spec.rb b/spec/extensions/topic_extension_spec.rb index 9b2d9ee5..da4f416e 100644 --- a/spec/extensions/topic_extension_spec.rb +++ b/spec/extensions/topic_extension_spec.rb @@ -15,12 +15,15 @@ describe Topic, type: :model do user, Guardian.new(user), valid_attrs.merge( + title: 'A valid and sufficiently long title for testing', category: category_with_wizard.id, - title: 'A valid title', - raw: 'hello this is a test topic' + raw: 'hello this is a test topic with category with custom fields' ) ) - end.to raise_error + end.to raise_error( + Discourse::InvalidParameters, + 'Category not allowed for topic creation.' + ) end end @@ -32,8 +35,8 @@ describe Topic, type: :model do Guardian.new(user), valid_attrs.merge( category: category_without_wizard.id, - title: 'Another valid title', - raw: 'This is a valid topic' + title: 'Another valid and sufficiently long title for testing', + raw: 'This is the body of a valid topic' ) ) end.not_to raise_error