diff options
Diffstat (limited to 'spec/models/users')
-rw-r--r-- | spec/models/users/in_product_marketing_email_spec.rb | 11 | ||||
-rw-r--r-- | spec/models/users/phone_number_validation_spec.rb | 24 |
2 files changed, 17 insertions, 18 deletions
diff --git a/spec/models/users/in_product_marketing_email_spec.rb b/spec/models/users/in_product_marketing_email_spec.rb index d333a51ae3b..b1642383e42 100644 --- a/spec/models/users/in_product_marketing_email_spec.rb +++ b/spec/models/users/in_product_marketing_email_spec.rb @@ -134,15 +134,4 @@ RSpec.describe Users::InProductMarketingEmail, type: :model, feature_category: : end end end - - describe '.ACTIVE_TRACKS' do - it 'has an entry for every track' do - tracks = Namespaces::InProductMarketingEmailsService::TRACKS.keys - expect(tracks).to match_array(described_class::ACTIVE_TRACKS.keys.map(&:to_sym)) - end - - it 'does not include INACTIVE_TRACK_NAMES' do - expect(described_class::ACTIVE_TRACKS.keys).not_to include(*described_class::INACTIVE_TRACK_NAMES) - end - end end diff --git a/spec/models/users/phone_number_validation_spec.rb b/spec/models/users/phone_number_validation_spec.rb index e41719d8ca3..15bbb507dee 100644 --- a/spec/models/users/phone_number_validation_spec.rb +++ b/spec/models/users/phone_number_validation_spec.rb @@ -39,16 +39,26 @@ RSpec.describe Users::PhoneNumberValidation, feature_category: :instance_resilie end context 'when banned user has the same international dial code and phone number' do - before do - create(:phone_number_validation, user: banned_user) + context 'and the matching record has not been verified' do + before do + create(:phone_number_validation, user: banned_user) + end + + it { is_expected.to eq(false) } end - it { is_expected.to eq(true) } + context 'and the matching record has been verified' do + before do + create(:phone_number_validation, :validated, user: banned_user) + end + + it { is_expected.to eq(true) } + end end context 'when banned user has the same international dial code and phone number, but different country code' do before do - create(:phone_number_validation, user: banned_user, country: 'CA') + create(:phone_number_validation, :validated, user: banned_user, country: 'CA') end it { is_expected.to eq(true) } @@ -56,7 +66,7 @@ RSpec.describe Users::PhoneNumberValidation, feature_category: :instance_resilie context 'when banned user does not have the same international dial code' do before do - create(:phone_number_validation, user: banned_user, international_dial_code: 61) + create(:phone_number_validation, :validated, user: banned_user, international_dial_code: 61) end it { is_expected.to eq(false) } @@ -64,7 +74,7 @@ RSpec.describe Users::PhoneNumberValidation, feature_category: :instance_resilie context 'when banned user does not have the same phone number' do before do - create(:phone_number_validation, user: banned_user, phone_number: '666') + create(:phone_number_validation, :validated, user: banned_user, phone_number: '666') end it { is_expected.to eq(false) } @@ -72,7 +82,7 @@ RSpec.describe Users::PhoneNumberValidation, feature_category: :instance_resilie context 'when not-banned user has the same international dial code and phone number' do before do - create(:phone_number_validation, user: user) + create(:phone_number_validation, :validated, user: user) end it { is_expected.to eq(false) } |