mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
Added pure PaperTrail stack
This commit is contained in:
parent
ea6bdc19f9
commit
09a816d5a8
27 changed files with 846 additions and 492 deletions
|
@ -8,6 +8,16 @@ describe Contact do
|
|||
|
||||
it { should have_one(:address) }
|
||||
|
||||
context 'about class' do
|
||||
it 'should have versioning enabled?' do
|
||||
Contact.paper_trail_enabled_for_model?.should == true
|
||||
end
|
||||
|
||||
it 'should have custom log prexied table name for versions table' do
|
||||
ContactVersion.table_name.should == 'log_contacts'
|
||||
end
|
||||
end
|
||||
|
||||
context 'with invalid attribute' do
|
||||
before :all do
|
||||
@contact = Contact.new
|
||||
|
@ -41,6 +51,10 @@ describe Contact do
|
|||
@contact.valid?
|
||||
@contact.errors[:phone].should == ["Phone nr is invalid"]
|
||||
end
|
||||
|
||||
it 'should not have any versions' do
|
||||
@contact.versions.should == []
|
||||
end
|
||||
end
|
||||
|
||||
context 'with valid attributes' do
|
||||
|
@ -57,6 +71,15 @@ describe Contact do
|
|||
@contact.relations_with_domain?.should == false
|
||||
end
|
||||
|
||||
it 'should not have one version' do
|
||||
with_versioning do
|
||||
@contact.versions.should == []
|
||||
@contact.name = 'New name'
|
||||
@contact.save
|
||||
@contact.versions.size.should == 1
|
||||
end
|
||||
end
|
||||
|
||||
# it 'ico should be valid' do
|
||||
# @contact.ident_type = 'ico'
|
||||
# @contact.ident = '1234'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue