2018-01-26 11:07:35 -05:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2018-02-02 16:51:03 -05:00
|
|
|
describe UserCallout do
|
2018-12-03 07:43:34 -05:00
|
|
|
let!(:callout) { create(:user_callout) }
|
|
|
|
|
2018-12-04 05:24:21 -05:00
|
|
|
it_behaves_like 'having unique enum values'
|
|
|
|
|
2018-01-26 11:07:35 -05:00
|
|
|
describe 'relationships' do
|
|
|
|
it { is_expected.to belong_to(:user) }
|
|
|
|
end
|
2018-02-01 21:07:33 -05:00
|
|
|
|
|
|
|
describe 'validations' do
|
|
|
|
it { is_expected.to validate_presence_of(:user) }
|
|
|
|
|
|
|
|
it { is_expected.to validate_presence_of(:feature_name) }
|
2018-02-02 18:16:24 -05:00
|
|
|
it { is_expected.to validate_uniqueness_of(:feature_name).scoped_to(:user_id).ignoring_case_sensitivity }
|
2018-02-01 21:07:33 -05:00
|
|
|
end
|
2018-01-26 11:07:35 -05:00
|
|
|
end
|