require 'rails_helper'

RSpec.describe Support::User, type: :model do
  subject { build(:support_user) }

  it { is_expected.to be_valid }

  describe 'associations' do
    it { should have_many(:tokens) }
    it { should have_one(:permission) }
  end

  describe 'validations' do
    it { should have_secure_password }
    it { should validate_presence_of(:username) }
    it { should validate_presence_of(:first_name) }
    it { should validate_presence_of(:last_name) }
    it { should validate_uniqueness_of(:username) }
  end
end
