mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 11:03:50 +08:00
13 lines
410 B
Ruby
13 lines
410 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe ReviewableClaimedTopic, type: :model do
|
|
it "respects the uniqueness constraint" do
|
|
topic = Fabricate(:topic)
|
|
|
|
ct = ReviewableClaimedTopic.new(topic_id: topic.id, user_id: Fabricate(:user).id)
|
|
expect(ct.save).to eq(true)
|
|
|
|
ct = ReviewableClaimedTopic.new(topic_id: topic.id, user_id: Fabricate(:user).id)
|
|
expect(ct.save).to eq(false)
|
|
end
|
|
end
|