mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
parent
9702864f62
commit
f96bf3100a
3 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue