mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Don't log a claimed topic database error during tests
We now test the uniqueness validation, but also rescue a DB exception in case the controller fails this check.
This commit is contained in:
@@ -33,6 +33,14 @@ describe ReviewableClaimedTopicsController do
|
||||
expect(response.code).to eq("200")
|
||||
expect(ReviewableClaimedTopic.where(user_id: moderator.id, topic_id: topic.id).exists?).to eq(true)
|
||||
end
|
||||
|
||||
it "won't an error if you claim twice" do
|
||||
SiteSetting.reviewable_claiming = 'optional'
|
||||
post "/reviewable_claimed_topics.json", params: params
|
||||
expect(ReviewableClaimedTopic.where(user_id: moderator.id, topic_id: topic.id).exists?).to eq(true)
|
||||
post "/reviewable_claimed_topics.json", params: params
|
||||
expect(response.code).to eq("200")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user