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_bot_spec.rb

31 lines
809 B
Ruby
Raw Normal View History

2018-11-29 08:24:37 -05:00
# frozen_string_literal: true
require 'rails_helper'
2018-11-30 02:00:03 -05:00
RSpec.describe TelegramBot do
2018-11-29 08:24:37 -05:00
subject { create :telegram_bot }
it { is_expected.to validate_presence_of :secret }
2018-11-29 09:08:23 -05:00
it { is_expected.to validate_presence_of :api_token }
2018-12-06 19:41:07 -05:00
2018-12-07 13:03:01 -05:00
pending '#client'
2018-12-06 19:41:07 -05:00
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
2018-11-29 08:24:37 -05:00
end