Added some missing model specs + PaperTrail session fix

This commit is contained in:
Priit Tark 2015-02-02 18:09:01 +02:00
parent c248a957a6
commit a637eb5e01
39 changed files with 1447 additions and 845 deletions

View file

@ -67,19 +67,26 @@ describe Contact do
@contact.errors.full_messages.should match_array([])
end
it 'should not have relation' do
@contact.relations_with_domain?.should == false
it 'should be valid twice' do
@contact = Fabricate(:contact)
@contact.valid?
@contact.errors.full_messages.should match_array([])
end
it 'should not have one version' do
it 'should have one version' do
with_versioning do
@contact.versions.should == []
@contact.versions.reload.should == []
@contact.name = 'New name'
@contact.save
@contact.errors.full_messages.should match_array([])
@contact.versions.size.should == 1
end
end
it 'should not have relation' do
@contact.relations_with_domain?.should == false
end
# it 'ico should be valid' do
# @contact.ident_type = 'ico'
# @contact.ident = '1234'