2019-05-12 21:55:44 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-05-08 10:20:51 -04:00
|
|
|
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
|