mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Add support for PG interval field
This commit is contained in:
parent
f22fc2659f
commit
838522b81a
8 changed files with 47 additions and 43 deletions
4
test/fixtures/billing/prices.yml
vendored
4
test/fixtures/billing/prices.yml
vendored
|
@ -1,5 +1,5 @@
|
|||
create_one_month:
|
||||
duration: 3 mons
|
||||
duration: 3 months
|
||||
price_cents: 100
|
||||
operation_category: create
|
||||
valid_from: 2010-07-05
|
||||
|
@ -7,7 +7,7 @@ create_one_month:
|
|||
zone: one
|
||||
|
||||
renew_one_month:
|
||||
duration: 1 mons
|
||||
duration: 1 month
|
||||
price_cents: 100
|
||||
operation_category: renew
|
||||
valid_from: 2010-07-05
|
||||
|
|
|
@ -75,7 +75,7 @@ class APIDomainTransfersTest < ApplicationIntegrationTest
|
|||
data: { success: [],
|
||||
failed: [{ type: "domain_transfer",
|
||||
domain_name: "shop.test",
|
||||
errors: [{:code=>"2304", :msg=>"Object status prohibits operation"}] }],
|
||||
errors: {:code=>"2304", :msg=>"Object status prohibits operation"} }],
|
||||
}}),
|
||||
JSON.parse(response.body, symbolize_names: true)
|
||||
end
|
||||
|
|
|
@ -65,7 +65,7 @@ class Billing::PriceTest < ActiveSupport::TestCase
|
|||
price.duration = 'invalid'
|
||||
assert price.invalid?
|
||||
|
||||
price.duration = Billing::Price.durations.first
|
||||
price.duration = Billing::Price.durations.values.first
|
||||
assert price.valid?
|
||||
end
|
||||
|
||||
|
@ -75,21 +75,21 @@ class Billing::PriceTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_returns_durations
|
||||
durations = [
|
||||
'3 mons',
|
||||
'6 mons',
|
||||
'9 mons',
|
||||
'1 year',
|
||||
'2 years',
|
||||
'3 years',
|
||||
'4 years',
|
||||
'5 years',
|
||||
'6 years',
|
||||
'7 years',
|
||||
'8 years',
|
||||
'9 years',
|
||||
'10 years',
|
||||
]
|
||||
durations = {
|
||||
'3 months' => 3.months,
|
||||
'6 months' => 6.months,
|
||||
'9 months' => 9.months,
|
||||
'1 year' => 1.year,
|
||||
'2 years'=> 2.years,
|
||||
'3 years'=> 3.years,
|
||||
'4 years'=> 4.years,
|
||||
'5 years'=> 5.years,
|
||||
'6 years'=> 6.years,
|
||||
'7 years'=> 7.years,
|
||||
'8 years'=> 8.years,
|
||||
'9 years'=> 9.years,
|
||||
'10 years'=> 10.years,
|
||||
}
|
||||
assert_equal durations, Billing::Price.durations
|
||||
end
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class RegistrantVerificationTest < ActiveSupport::TestCase
|
|||
random_action = "random#{rand(100)}"
|
||||
|
||||
assert_difference -> { Version::RegistrantVerificationVersion.count } do
|
||||
registrant_verification.update_attributes!(action: random_action)
|
||||
registrant_verification.update!(action: random_action)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ class AdminAreaPricesTest < ApplicationSystemTestCase
|
|||
fill_in 'Valid from', with: effective_date
|
||||
click_on 'Create price'
|
||||
|
||||
|
||||
assert_text 'Price has been created'
|
||||
assert_text I18n.localize(effective_date)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue