From e46423b4ac2063285873fb340771d49a57fa0ae7 Mon Sep 17 00:00:00 2001 From: Daniel M Brasil Date: Fri, 22 Nov 2024 15:40:42 -0300 Subject: [PATCH] use allow_values helper --- spec/models/ip_block_spec.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/spec/models/ip_block_spec.rb b/spec/models/ip_block_spec.rb index 9a4119e01e..5e23b5991f 100644 --- a/spec/models/ip_block_spec.rb +++ b/spec/models/ip_block_spec.rb @@ -7,15 +7,11 @@ RSpec.describe IpBlock do subject { Fabricate.build :ip_block } it { is_expected.to validate_presence_of(:ip) } + it { is_expected.to validate_presence_of(:severity) } it { is_expected.to validate_uniqueness_of(:ip) } - it 'validates severity inclusion', :aggregate_failures do - ip_block = described_class.new(ip: '127.0.0.1', severity: :invalid) - - expect(ip_block).to_not be_valid - expect(ip_block).to model_have_error_on_field(:severity) - end + it { is_expected.to allow_values(:sign_up_requires_approval, :sign_up_block, :no_access).for(:severity) } end describe '#to_log_human_identifier' do