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:
parent
d4638ebf69
commit
77f9fff41e
|
@ -2745,8 +2745,9 @@ RSpec.describe TopicsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should fail for non-existend topic" do
|
it "should fail for non-existend topic" do
|
||||||
|
max_id = Topic.maximum(:id)
|
||||||
sign_in(Fabricate(:admin))
|
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)
|
expect(response.status).to eq(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue