Fix price version

#475
This commit is contained in:
Artur Beljajev 2017-04-27 09:39:25 +03:00
parent 9702864f62
commit f96bf3100a
3 changed files with 12 additions and 1 deletions

View file

@ -1,5 +1,8 @@
module Billing
class Price < ActiveRecord::Base
include Versions
has_paper_trail class_name: '::PriceVersion'
self.auto_html5_validation = false
belongs_to :zone, class_name: 'DNS::Zone', required: true

View file

@ -1,4 +1,4 @@
class PricelistVersion < PaperTrail::Version
class PriceVersion < PaperTrail::Version
self.table_name = :log_pricelists
self.sequence_name = :log_pricelists_id_seq
end

View file

@ -4,6 +4,14 @@ RSpec.describe Billing::Price do
it { is_expected.to monetize(:price) }
it { is_expected.to be_versioned }
it 'should have one version' do
with_versioning do
price = build(:price)
price.save!
price.versions.size.should == 1
end
end
describe '::operation_categories', db: false do
it 'returns available operation categories' do
categories = %w[create renew]