Files
discourse/spec/models/reviewable_claimed_topic_spec.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
412 B
Ruby
Raw Normal View History

2019-05-13 09:55:44 +08:00
# frozen_string_literal: true
2019-05-08 10:20:51 -04:00
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)
2019-05-08 10:20:51 -04:00
end
end