require 'rails_helper'

RSpec.describe AccountAuth, type: :model do
  describe "associations" do
    it { is_expected.to belong_to(:user) }
    it { is_expected.to belong_to(:account) }
  end

  describe "enums" do
    it { is_expected.to define_enum_for(:role).with_values(associate: 0, project_manager: 1, account_manager: 2) }
  end

  describe "validations" do 
    describe "#user_id" do 
      it { is_expected.to validate_uniqueness_of(:user_id).scoped_to(:account_id).with_message("already added to account.") } 
    end
  end
end
