From 6450b1698d456518e6d9393d7ecdff4785c946bd Mon Sep 17 00:00:00 2001 From: Nicolae Claudius Date: Sat, 8 Oct 2011 14:23:59 -0700 Subject: [PATCH] test serial updates correctly --- spec/models/domain_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/models/domain_spec.rb b/spec/models/domain_spec.rb index abfe058..64e8e83 100644 --- a/spec/models/domain_spec.rb +++ b/spec/models/domain_spec.rb @@ -5,6 +5,7 @@ describe Domain do domain = Factory.build(:domain) domain.setup(FactoryGirl.generate(:email)) domain.save! + domain.soa_record.update_serial! domain } @@ -22,6 +23,10 @@ describe Domain do it "has correct records" do domain.records.count.should == 3 end + + it "has a soa serial updated" do + (domain.soa_record.serial % 10).should == 1 + end it "updates name to records when name changed" do domain.update_attributes(:name => "changed#{domain.name}") @@ -30,5 +35,6 @@ describe Domain do for record in domain.records.all record.name.should =~ /#{domain.name}$/ end + (domain.soa_record.serial % 10).should == 0 end end