Added more epp tests about domain verify logic #2557

This commit is contained in:
Priit Tark 2015-05-28 17:02:59 +03:00
parent 573349d0b6
commit 340ca96d1e
2 changed files with 98 additions and 0 deletions

View file

@ -106,6 +106,27 @@ describe Domain do
end
end
context 'about registrant update confirm when domain is invalid' do
before :all do
@domain.registrant_verification_token = 123
@domain.registrant_verification_asked_at = Time.zone.now
@domain.domain_statuses.create(value: DomainStatus::PENDING_UPDATE)
end
it 'should be registrant update confirm ready' do
@domain.registrant_update_confirmable?('123').should == true
end
it 'should not be registrant update confirm ready when token does not match' do
@domain.registrant_update_confirmable?('wrong-token').should == false
end
it 'should not be registrant update confirm ready when no correct status' do
@domain.domain_statuses.delete_all
@domain.registrant_update_confirmable?('123').should == false
end
end
context 'with versioning' do
it 'should not have one version' do
with_versioning do