mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 22:23:44 +08:00
15 lines
366 B
Ruby
15 lines
366 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe ReviewableClaimedTopic, type: :model do
|
|
|
|
it "ensures uniqueness" do
|
|
claimed = Fabricate(:reviewable_claimed_topic)
|
|
expect(-> {
|
|
ReviewableClaimedTopic.create!(topic_id: claimed.topic_id, user_id: Fabricate(:user).id)
|
|
}).to raise_error(ActiveRecord::RecordNotUnique)
|
|
end
|
|
|
|
end
|