require 'rails_helper'

RSpec.describe Support::Permission, type: :model do
  subject { build(:support_permission) }

  describe 'associations' do
    it { should belong_to(:user) }
  end

  describe 'validations' do
    it do
      should define_enum_for(:users)
        .with_prefix(true)
        .with_values([:none, :read, :write, :manage])
    end
    it do
      should define_enum_for(:training)
        .with_prefix(true)
        .with_values([:none, :read, :write, :manage])
    end
    it do
      should define_enum_for(:communication)
        .with_prefix(true)
        .with_values([:none, :read, :write, :manage])
    end
    it do
      should define_enum_for(:sites)
        .with_prefix(true)
        .with_values([:none, :read, :write, :manage])
    end
  end
end
