Browse Source

test serial updates correctly

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
6450b1698d
  1. 6
      spec/models/domain_spec.rb

6
spec/models/domain_spec.rb

@ -5,6 +5,7 @@ describe Domain do
domain = Factory.build(:domain) domain = Factory.build(:domain)
domain.setup(FactoryGirl.generate(:email)) domain.setup(FactoryGirl.generate(:email))
domain.save! domain.save!
domain.soa_record.update_serial!
domain domain
} }
@ -23,6 +24,10 @@ describe Domain do
domain.records.count.should == 3 domain.records.count.should == 3
end 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 it "updates name to records when name changed" do
domain.update_attributes(:name => "changed#{domain.name}") domain.update_attributes(:name => "changed#{domain.name}")
domain.soa_record.name.should == domain.name domain.soa_record.name.should == domain.name
@ -30,5 +35,6 @@ describe Domain do
for record in domain.records.all for record in domain.records.all
record.name.should =~ /#{domain.name}$/ record.name.should =~ /#{domain.name}$/
end end
(domain.soa_record.serial % 10).should == 0
end end
end end

Loading…
Cancel
Save