From 0d9ab0beb3a8cc3489f31a3fa2523ce50acfa503 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Tue, 11 Jan 2022 01:51:57 +0100 Subject: [PATCH] DEV: Fix a flaky spec (#15529) It's very much possible for there to be a topic with id 999. --- spec/requests/topics_controller_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/requests/topics_controller_spec.rb b/spec/requests/topics_controller_spec.rb index 994ca38cbb1..e1dfc7acd16 100644 --- a/spec/requests/topics_controller_spec.rb +++ b/spec/requests/topics_controller_spec.rb @@ -3986,7 +3986,9 @@ RSpec.describe TopicsController do describe 'when topic id is invalid' do it 'should return the right response' do - post "/t/999/invite.json", params: { + id = topic.id + topic.destroy! + post "/t/#{id}/invite.json", params: { email: user.email }