mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
parent
a3b3490591
commit
22a2329ba5
7 changed files with 28 additions and 13 deletions
|
@ -24,7 +24,12 @@ RSpec.describe 'admin price create', settings: false do
|
|||
expect(price.operation_category).to eq(Billing::Price.operation_categories.first)
|
||||
end
|
||||
|
||||
it 'saves duration' do
|
||||
it 'saves duration in months' do
|
||||
post admin_prices_path, price: attributes_for(:price, zone_id: '1', duration: '3 mons')
|
||||
expect(price.duration).to eq('3 mons')
|
||||
end
|
||||
|
||||
it 'saves duration in years' do
|
||||
post admin_prices_path, price: attributes_for(:price, zone_id: '1', duration: '1 year')
|
||||
expect(price.duration).to eq('1 year')
|
||||
end
|
||||
|
|
|
@ -25,7 +25,16 @@ RSpec.describe 'admin price update', settings: false do
|
|||
expect(price.operation_category).to eq(Billing::Price.operation_categories.second)
|
||||
end
|
||||
|
||||
it 'updates duration' do
|
||||
it 'updates duration in months' do
|
||||
price = create(:price, duration: '3 mons')
|
||||
|
||||
patch admin_price_path(price), price: attributes_for(:price, duration: '6 mons')
|
||||
price.reload
|
||||
|
||||
expect(price.duration).to eq('6 mons')
|
||||
end
|
||||
|
||||
it 'updates duration in years' do
|
||||
price = create(:price, duration: '1 year')
|
||||
|
||||
patch admin_price_path(price), price: attributes_for(:price, duration: '2 years')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue