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
Raw Normal View History

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