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

@ -30,4 +30,31 @@ describe Registrar do
@registrar.errors[:billing_email].should == ['is invalid']
end
end
context 'with valid attributes' do
before :all do
@registrar = Fabricate(:registrar)
end
it 'should be valid' do
@registrar.valid?
@registrar.errors.full_messages.should match_array([])
end
it 'should be valid twice' do
@registrar = Fabricate(:registrar)
@registrar.valid?
@registrar.errors.full_messages.should match_array([])
end
it 'should have one version' do
with_versioning do
@registrar.versions.should == []
@registrar.name = 'New name'
@registrar.save
@registrar.errors.full_messages.should match_array([])
@registrar.versions.size.should == 1
end
end
end
end