1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

add model specs

This commit is contained in:
Daniel M Brasil 2024-03-05 10:59:39 -03:00
parent c24f31ca50
commit 70fb99488d
No known key found for this signature in database
GPG key ID: AE1A28A226D1E692

View file

@ -18,6 +18,13 @@ describe IpBlock do
expect(ip_block).to model_have_error_on_field(:severity)
end
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 'validates ip uniqueness', :aggregate_failures do
described_class.create!(ip: '127.0.0.1', severity: :no_access)