Add period unit support to domain price method #2741

This commit is contained in:
Martin Lensment 2015-07-02 17:49:40 +03:00
parent 98439b896c
commit 61dfe6e1f3
2 changed files with 26 additions and 1 deletions

View file

@ -182,6 +182,26 @@ describe Domain do
@domain.force_delete_at.should be_nil
end
it 'should know its price' do
Fabricate(:pricelist, {
category: 'ee',
operation_category: 'create',
duration: '1year',
price: 1.50,
valid_from: Time.zone.parse('2015-01-01'),
valid_to: nil
})
domain = Fabricate(:domain)
domain.price('create').should == 1.50
domain = Fabricate(:domain, period: 12, period_unit: 'm')
domain.price('create').should == 1.50
domain = Fabricate(:domain, period: 365, period_unit: 'd')
domain.price('create').should == 1.50
end
context 'about registrant update confirm' do
before :all do
@domain.registrant_verification_token = 123