summaryrefslogtreecommitdiff
path: root/spec/models/user_callout_spec.rb
blob: b87f6f03d6fe790ad803a7384b0c6b2d1dce9fa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

require 'rails_helper'

describe UserCallout do
  let!(:callout) { create(:user_callout) }

  it_behaves_like 'having unique enum values'

  describe 'relationships' do
    it { is_expected.to belong_to(:user) }
  end

  describe 'validations' do
    it { is_expected.to validate_presence_of(:user) }

    it { is_expected.to validate_presence_of(:feature_name) }
    it { is_expected.to validate_uniqueness_of(:feature_name).scoped_to(:user_id).ignoring_case_sensitivity }
  end
end