mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
parent
1891a6305b
commit
f55169c2b4
2 changed files with 7 additions and 44 deletions
|
@ -37,7 +37,7 @@ class Epp::DomainsController < EppController
|
||||||
sum: @domain_pricelist.price.amount,
|
sum: @domain_pricelist.price.amount,
|
||||||
description: "#{I18n.t('create')} #{@domain.name}",
|
description: "#{I18n.t('create')} #{@domain.name}",
|
||||||
activity_type: AccountActivity::CREATE,
|
activity_type: AccountActivity::CREATE,
|
||||||
log_pricelist_id: @domain_pricelist.id
|
price: @domain_pricelist
|
||||||
})
|
})
|
||||||
|
|
||||||
render_epp_response '/epp/domains/create'
|
render_epp_response '/epp/domains/create'
|
||||||
|
@ -124,7 +124,7 @@ class Epp::DomainsController < EppController
|
||||||
sum: @domain_pricelist.price.amount,
|
sum: @domain_pricelist.price.amount,
|
||||||
description: "#{I18n.t('renew')} #{@domain.name}",
|
description: "#{I18n.t('renew')} #{@domain.name}",
|
||||||
activity_type: AccountActivity::RENEW,
|
activity_type: AccountActivity::RENEW,
|
||||||
log_pricelist_id: @domain_pricelist.id
|
price: @domain_pricelist
|
||||||
})
|
})
|
||||||
|
|
||||||
render_epp_response '/epp/domains/renew'
|
render_epp_response '/epp/domains/renew'
|
||||||
|
|
|
@ -1,48 +1,11 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
RSpec.describe Account do
|
RSpec.describe Account do
|
||||||
context 'with invalid attribute' do
|
it 'has versions' do
|
||||||
before :all do
|
|
||||||
@account = Account.new
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should not be valid' do
|
|
||||||
@account.valid?
|
|
||||||
@account.errors.full_messages.should match_array(["Account type is missing"])
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should not have any versions' do
|
|
||||||
@account.versions.should == []
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with valid attributes' do
|
|
||||||
before :all do
|
|
||||||
@account = Fabricate(:account)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should be valid' do
|
|
||||||
@account.valid?
|
|
||||||
@account.errors.full_messages.should match_array([])
|
|
||||||
s = 0.0
|
|
||||||
@account.activities.map { |x| s += x.sum }
|
|
||||||
@account.balance.should == s
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should be valid twice' do
|
|
||||||
@account = Fabricate(:account)
|
|
||||||
@account.valid?
|
|
||||||
@account.errors.full_messages.should match_array([])
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should have one version' do
|
|
||||||
with_versioning do
|
with_versioning do
|
||||||
@account.versions.should == []
|
price = build(:account)
|
||||||
@account.account_type = 'new_type'
|
price.save!
|
||||||
@account.save
|
expect(price.versions.size).to be(1)
|
||||||
@account.errors.full_messages.should match_array([])
|
|
||||||
@account.versions.size.should == 1
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue