2019-03-30 03:23:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-28 12:49:42 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe UserCustomAttribute do
|
2017-09-28 12:49:42 -04:00
|
|
|
describe 'assocations' do
|
|
|
|
it { is_expected.to belong_to(:user) }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'validations' do
|
|
|
|
subject { build :user_custom_attribute }
|
|
|
|
|
|
|
|
it { is_expected.to validate_presence_of(:user_id) }
|
|
|
|
it { is_expected.to validate_presence_of(:key) }
|
|
|
|
it { is_expected.to validate_presence_of(:value) }
|
|
|
|
it { is_expected.to validate_uniqueness_of(:key).scoped_to(:user_id) }
|
|
|
|
end
|
|
|
|
end
|