# frozen_string_literal: true
require 'rails_helper'
RSpec.describe TelegramChat do
subject { create :telegram_chat }
it do
is_expected.to \
have_one(:account_telegram_contact)
.dependent(:restrict_with_exception)
end
it { is_expected.to validate_presence_of :remote_id }
it { is_expected.to validate_presence_of :chat_type }
it { is_expected.not_to validate_presence_of :title }
it { is_expected.not_to validate_presence_of :username }
it { is_expected.not_to validate_presence_of :first_name }
it { is_expected.not_to validate_presence_of :last_name }
it { is_expected.to validate_uniqueness_of :remote_id }
validate_inclusion_of(:chat_type)
.in_array(%w[private group supergroup channel])