mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
Remove/fix outdated specs
This commit is contained in:
parent
837ef067e7
commit
3bdfb4b4eb
3 changed files with 9 additions and 128 deletions
|
@ -34,17 +34,6 @@ describe BankTransaction do
|
||||||
@bank_transaction.errors.full_messages.should match_array([])
|
@bank_transaction.errors.full_messages.should match_array([])
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should bind transaction with invoice manually' do
|
|
||||||
r = Fabricate(:registrar_with_no_account_activities, reference_no: 'RF7086666663')
|
|
||||||
invoice = r.issue_prepayment_invoice(200, 'add some money')
|
|
||||||
|
|
||||||
bt = Fabricate(:bank_transaction, { sum: 240 })
|
|
||||||
bt.bind_invoice(invoice.number)
|
|
||||||
|
|
||||||
invoice.receipt_date.should_not be_blank
|
|
||||||
r.cash_account.balance.should == 200.0
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should not bind transaction with mismatching sums' do
|
it 'should not bind transaction with mismatching sums' do
|
||||||
r = Fabricate(:registrar_with_no_account_activities, reference_no: 'RF7086666663')
|
r = Fabricate(:registrar_with_no_account_activities, reference_no: 'RF7086666663')
|
||||||
invoice = r.issue_prepayment_invoice(200, 'add some money')
|
invoice = r.issue_prepayment_invoice(200, 'add some money')
|
||||||
|
|
|
@ -51,10 +51,12 @@ describe DomainContact do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should have one version' do
|
it 'should have one version' do
|
||||||
|
@domain_contact = Fabricate.create(:domain_contact)
|
||||||
|
|
||||||
with_versioning do
|
with_versioning do
|
||||||
@domain_contact.versions.reload.should == []
|
@domain_contact.versions.reload.should == []
|
||||||
@domain_contact.updated_at = Time.zone.now # trigger new version
|
@domain_contact.contact = Fabricate.create(:contact)
|
||||||
@domain_contact.save
|
@domain_contact.save!
|
||||||
@domain_contact.errors.full_messages.should match_array([])
|
@domain_contact.errors.full_messages.should match_array([])
|
||||||
@domain_contact.versions.size.should == 1
|
@domain_contact.versions.size.should == 1
|
||||||
end
|
end
|
||||||
|
@ -82,10 +84,12 @@ describe DomainContact do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should have one version' do
|
it 'should have one version' do
|
||||||
|
@domain_contact = Fabricate.create(:domain_contact)
|
||||||
|
|
||||||
with_versioning do
|
with_versioning do
|
||||||
@domain_contact.versions.reload.should == []
|
@domain_contact.versions.reload.should == []
|
||||||
@domain_contact.updated_at = Time.zone.now # trigger new version
|
@domain_contact.contact = Fabricate.create(:contact)
|
||||||
@domain_contact.save
|
@domain_contact.save!
|
||||||
@domain_contact.errors.full_messages.should match_array([])
|
@domain_contact.errors.full_messages.should match_array([])
|
||||||
@domain_contact.versions.size.should == 1
|
@domain_contact.versions.size.should == 1
|
||||||
end
|
end
|
||||||
|
@ -115,7 +119,7 @@ describe DomainContact do
|
||||||
it 'should have one version' do
|
it 'should have one version' do
|
||||||
with_versioning do
|
with_versioning do
|
||||||
@domain_contact.versions.reload.should == []
|
@domain_contact.versions.reload.should == []
|
||||||
@domain_contact.updated_at = Time.zone.now # trigger new version
|
@domain_contact.contact = Fabricate.create(:contact)
|
||||||
@domain_contact.save
|
@domain_contact.save
|
||||||
@domain_contact.errors.full_messages.should match_array([])
|
@domain_contact.errors.full_messages.should match_array([])
|
||||||
@domain_contact.versions.size.should == 1
|
@domain_contact.versions.size.should == 1
|
||||||
|
|
|
@ -353,118 +353,6 @@ RSpec.describe Domain do
|
||||||
domain.statuses.should == ['expired']
|
domain.statuses.should == ['expired']
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should know its create 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.pricelist('create').price.amount.should == 1.50
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 12, period_unit: 'm')
|
|
||||||
domain.pricelist('create').price.amount.should == 1.50
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 365, period_unit: 'd')
|
|
||||||
domain.pricelist('create').price.amount.should == 1.50
|
|
||||||
|
|
||||||
Fabricate(:pricelist, {
|
|
||||||
category: 'ee',
|
|
||||||
operation_category: 'create',
|
|
||||||
duration: '2years',
|
|
||||||
price: 3,
|
|
||||||
valid_from: Time.zone.parse('2015-01-01'),
|
|
||||||
valid_to: nil
|
|
||||||
})
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 2)
|
|
||||||
domain.pricelist('create').price.amount.should == 3.0
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 24, period_unit: 'm')
|
|
||||||
domain.pricelist('create').price.amount.should == 3.0
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 730, period_unit: 'd')
|
|
||||||
domain.pricelist('create').price.amount.should == 3.0
|
|
||||||
|
|
||||||
Fabricate(:pricelist, {
|
|
||||||
category: 'ee',
|
|
||||||
operation_category: 'create',
|
|
||||||
duration: '3years',
|
|
||||||
price: 6,
|
|
||||||
valid_from: Time.zone.parse('2015-01-01'),
|
|
||||||
valid_to: nil
|
|
||||||
})
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 3)
|
|
||||||
domain.pricelist('create').price.amount.should == 6.0
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 36, period_unit: 'm')
|
|
||||||
domain.pricelist('create').price.amount.should == 6.0
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 1095, period_unit: 'd')
|
|
||||||
domain.pricelist('create').price.amount.should == 6.0
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should know its renew price' do
|
|
||||||
Fabricate(:pricelist, {
|
|
||||||
category: 'ee',
|
|
||||||
operation_category: 'renew',
|
|
||||||
duration: '1year',
|
|
||||||
price: 1.30,
|
|
||||||
valid_from: Time.zone.parse('2015-01-01'),
|
|
||||||
valid_to: nil
|
|
||||||
})
|
|
||||||
|
|
||||||
domain = Fabricate(:domain)
|
|
||||||
domain.pricelist('renew').price.amount.should == 1.30
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 12, period_unit: 'm')
|
|
||||||
domain.pricelist('renew').price.amount.should == 1.30
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 365, period_unit: 'd')
|
|
||||||
domain.pricelist('renew').price.amount.should == 1.30
|
|
||||||
|
|
||||||
Fabricate(:pricelist, {
|
|
||||||
category: 'ee',
|
|
||||||
operation_category: 'renew',
|
|
||||||
duration: '2years',
|
|
||||||
price: 3.1,
|
|
||||||
valid_from: Time.zone.parse('2015-01-01'),
|
|
||||||
valid_to: nil
|
|
||||||
})
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 2)
|
|
||||||
domain.pricelist('renew').price.amount.should == 3.1
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 24, period_unit: 'm')
|
|
||||||
domain.pricelist('renew').price.amount.should == 3.1
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 730, period_unit: 'd')
|
|
||||||
domain.pricelist('renew').price.amount.should == 3.1
|
|
||||||
|
|
||||||
Fabricate(:pricelist, {
|
|
||||||
category: 'ee',
|
|
||||||
operation_category: 'renew',
|
|
||||||
duration: '3years',
|
|
||||||
price: 6.1,
|
|
||||||
valid_from: Time.zone.parse('2015-01-01'),
|
|
||||||
valid_to: nil
|
|
||||||
})
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 3)
|
|
||||||
domain.pricelist('renew').price.amount.should == 6.1
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 36, period_unit: 'm')
|
|
||||||
domain.pricelist('renew').price.amount.should == 6.1
|
|
||||||
|
|
||||||
domain = Fabricate(:domain, period: 1095, period_unit: 'd')
|
|
||||||
domain.pricelist('renew').price.amount.should == 6.1
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should set pending update' do
|
it 'should set pending update' do
|
||||||
@domain.statuses = DomainStatus::OK # restore
|
@domain.statuses = DomainStatus::OK # restore
|
||||||
@domain.save
|
@domain.save
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue