diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-13 15:10:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-13 15:10:07 +0300 |
commit | df592d51aeadc1b566abb600e283341876a8f064 (patch) | |
tree | 6b9acbcf1da5c40cceece035b0126a354f68650a /spec/models/users/phone_number_validation_spec.rb | |
parent | 7ece9a7935fca35a8d91d2cb29bfad453b69be12 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/users/phone_number_validation_spec.rb')
-rw-r--r-- | spec/models/users/phone_number_validation_spec.rb | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/spec/models/users/phone_number_validation_spec.rb b/spec/models/users/phone_number_validation_spec.rb index 890109e99e5..e41719d8ca3 100644 --- a/spec/models/users/phone_number_validation_spec.rb +++ b/spec/models/users/phone_number_validation_spec.rb @@ -95,12 +95,6 @@ RSpec.describe Users::PhoneNumberValidation, feature_category: :instance_resilie end end end - - describe '#by_reference_id' do - it 'returns the correct phone number record for the given reference_id' do - expect(described_class.by_reference_id('target')).to eq phone_number_record_1 - end - end end describe '#validated?' do @@ -122,4 +116,20 @@ RSpec.describe Users::PhoneNumberValidation, feature_category: :instance_resilie end end end + + describe '.by_reference_id' do + let_it_be(:phone_number_record) { create(:phone_number_validation) } + + let(:ref_id) { phone_number_record.telesign_reference_xid } + + subject { described_class.by_reference_id(ref_id) } + + it { is_expected.to eq phone_number_record } + + context 'when there is no matching record' do + let(:ref_id) { 'does-not-exist' } + + it { is_expected.to be_nil } + end + end end |