1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/spec/models/telegram_chat_spec.rb

23 lines
665 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe TelegramChat do
subject { create :telegram_chat }
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 }
it do
is_expected.to \
validate_inclusion_of(:chat_type)
.in_array(%w[private group supergroup channel])
end
end