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

31 lines
809 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe TelegramBot do
subject { create :telegram_bot }
it { is_expected.to validate_presence_of :secret }
it { is_expected.to validate_presence_of :api_token }
pending '#client'
describe '#username' do
def allow_value(*)
super.for :username
end
it { is_expected.to allow_value nil }
it { is_expected.not_to allow_value '' }
it { is_expected.not_to allow_value ' ' }
it { is_expected.not_to allow_value ' ' * rand(2..10) }
it { is_expected.to allow_value Faker::Internet.username nil, %w[_] }
it { is_expected.to allow_value 'foo123_456_BAR' }
it { is_expected.not_to allow_value Faker::Internet.email }
it { is_expected.not_to allow_value Faker::PhoneNumber.phone_number }
end
end