Skip to content

Commit eb073fe

Browse files
committed
DEV: Fix a flaky spec
Sometimes, the topic id actually exists for that spec (id being 1) and it will raise about not finding the group id instead of not finding the provided topic because the assignees group wasn’t provided in the `fields` parameter.
1 parent fbd1fa3 commit eb073fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec/lib/random_assign_utils_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,12 @@
207207
end
208208

209209
context "when assigned_topic is not found" do
210-
let(:fields) { { "assigned_topic" => { "value" => 1 } } }
210+
let(:fields) do
211+
{ "assigned_topic" => { "value" => -1 }, "assignees_group" => { "value" => group_1.id } }
212+
end
211213

212214
it "raises an error" do
213-
expect { auto_assign }.to raise_error(/Topic\(1\) not found/)
215+
expect { auto_assign }.to raise_error(/Topic\(-1\) not found/)
214216
end
215217
end
216218

0 commit comments

Comments
 (0)