diff --git a/app/controllers/epp/domains_controller.rb b/app/controllers/epp/domains_controller.rb index 6962f42c8..02c75c7da 100644 --- a/app/controllers/epp/domains_controller.rb +++ b/app/controllers/epp/domains_controller.rb @@ -37,7 +37,7 @@ class Epp::DomainsController < EppController sum: @domain_pricelist.price.amount, description: "#{I18n.t('create')} #{@domain.name}", activity_type: AccountActivity::CREATE, - log_pricelist_id: @domain_pricelist.id + price: @domain_pricelist }) render_epp_response '/epp/domains/create' @@ -124,7 +124,7 @@ class Epp::DomainsController < EppController sum: @domain_pricelist.price.amount, description: "#{I18n.t('renew')} #{@domain.name}", activity_type: AccountActivity::RENEW, - log_pricelist_id: @domain_pricelist.id + price: @domain_pricelist }) render_epp_response '/epp/domains/renew' diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index f3ba1fdb5..83e40b86e 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -1,48 +1,11 @@ require 'rails_helper' RSpec.describe Account do - context 'with invalid attribute' 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 - @account.versions.should == [] - @account.account_type = 'new_type' - @account.save - @account.errors.full_messages.should match_array([]) - @account.versions.size.should == 1 - end + it 'has versions' do + with_versioning do + price = build(:account) + price.save! + expect(price.versions.size).to be(1) end end