This commit is contained in:
Martin Lensment 2015-08-03 17:11:56 +03:00
parent e8e730a6e1
commit 1a7360cc3c
3 changed files with 40 additions and 23 deletions

View file

@ -33,7 +33,9 @@ describe ZonefileSetting do
it 'does not create duplicate zones' do
Fabricate(:zonefile_setting)
expect { Fabricate(:zonefile_setting) }.to raise_error(ActiveRecord::RecordInvalid)
zs = Fabricate.build(:zonefile_setting)
zs.save.should == false
zs.errors.full_messages.should match_array(["Origin has already been taken"])
end
it 'does not allow deleting zone when it has existing domains' do