mirror of
https://github.com/internetee/registry.git
synced 2025-08-12 12:39:34 +02:00
Add blocked domain model test #2564
This commit is contained in:
parent
2aeba8490f
commit
0e3e9e5327
1 changed files with 34 additions and 0 deletions
34
spec/models/blocked_domain_spec.rb
Normal file
34
spec/models/blocked_domain_spec.rb
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
describe BlockedDomain do
|
||||||
|
context 'with no attributes' do
|
||||||
|
before :all do
|
||||||
|
@blocked_domain = BlockedDomain.new
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should have names array' do
|
||||||
|
@blocked_domain.names.should == []
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with valid attributes' do
|
||||||
|
before :all do
|
||||||
|
@blocked_domain = Fabricate(:blocked_domain)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should be valid' do
|
||||||
|
@blocked_domain.valid?
|
||||||
|
@blocked_domain.errors.full_messages.should match_array([])
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should have one version' do
|
||||||
|
with_versioning do
|
||||||
|
@blocked_domain.versions.should == []
|
||||||
|
@blocked_domain.names = ['bla.ee']
|
||||||
|
@blocked_domain.save
|
||||||
|
@blocked_domain.errors.full_messages.should match_array([])
|
||||||
|
@blocked_domain.versions.size.should == 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue