Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix a flaky spec (#15529)

Jarek Radosz0d9ab0beb3a8
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
}