diff options
Diffstat (limited to 'spec/models/concerns/sha_attribute_spec.rb')
-rw-r--r-- | spec/models/concerns/sha_attribute_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/models/concerns/sha_attribute_spec.rb b/spec/models/concerns/sha_attribute_spec.rb index 790e6936803..fca94b50fee 100644 --- a/spec/models/concerns/sha_attribute_spec.rb +++ b/spec/models/concerns/sha_attribute_spec.rb @@ -72,9 +72,10 @@ RSpec.describe ShaAttribute do end it 'validates column type' do - if expected_error == :no_error + case expected_error + when :no_error expect { load_schema! }.not_to raise_error - elsif expected_error == :sha_mismatch_error + when :sha_mismatch_error expect { load_schema! }.to raise_error( described_class::ShaAttributeTypeMismatchError, /sha_attribute.*#{column_name}.* should be a :binary column/ @@ -89,9 +90,10 @@ RSpec.describe ShaAttribute do end it 'validates column type' do - if expected_error == :no_error + case expected_error + when :no_error expect { load_schema! }.not_to raise_error - elsif expected_error == :sha_mismatch_error + when :sha_mismatch_error expect { load_schema! }.to raise_error( described_class::Sha256AttributeTypeMismatchError, /sha256_attribute.*#{column_name}.* should be a :binary column/ |