mirror of https://github.com/mastodon/mastodon
add model specs
This commit is contained in:
parent
c24f31ca50
commit
70fb99488d
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue