DEV: correct flaky test

Hardcoding the number 1 into a test means that the test may fail if topic_id
1 is somehow seeded

This ensures we are always talking about a topic that does not exist
This commit is contained in:
Sam Saffron 2019-05-08 09:31:47 +10:00
parent d4638ebf69
commit 77f9fff41e
1 changed files with 2 additions and 1 deletions

View File

@ -2745,8 +2745,9 @@ RSpec.describe TopicsController do
end
it "should fail for non-existend topic" do
max_id = Topic.maximum(:id)
sign_in(Fabricate(:admin))
put "/t/1/reset-bump-date.json"
put "/t/#{max_id + 1}/reset-bump-date.json"
expect(response.status).to eq(404)
end
end