Refactor prices

#475
This commit is contained in:
Artur Beljajev 2017-04-26 00:51:06 +03:00
parent 5fdc1938af
commit 5a533e09bf
44 changed files with 1027 additions and 375 deletions

View file

@ -3,13 +3,14 @@ require 'rails_helper'
RSpec.describe 'EPP domain:renew' do
let(:request) { post '/epp/command/renew', frame: request_xml }
let!(:user) { create(:api_user_epp, registrar: registrar) }
let!(:pricelist) { create(:pricelist,
category: 'com',
duration: '1year',
price: Money.from_amount(1),
operation_category: 'renew',
valid_from: Time.zone.parse('05.07.2010'),
valid_to: Time.zone.parse('05.07.2010'))
let!(:zone) { create(:zone, origin: 'test') }
let!(:price) { create(:price,
duration: '1 year',
price: Money.from_amount(1),
operation_category: 'renew',
valid_from: Time.zone.parse('05.07.2010'),
valid_to: Time.zone.parse('05.07.2010'),
zone: zone)
}
before :example do
@ -22,7 +23,7 @@ RSpec.describe 'EPP domain:renew' do
let!(:registrar) { create(:registrar_with_unlimited_balance) }
let!(:domain) { create(:domain,
registrar: registrar,
name: 'test.com',
name: 'test.test',
expire_time: Time.zone.parse('05.07.2010'))
}
let(:request_xml) { <<-XML
@ -31,7 +32,7 @@ RSpec.describe 'EPP domain:renew' do
<command>
<renew>
<domain:renew xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
<domain:name>test.com</domain:name>
<domain:name>test.test</domain:name>
<domain:curExpDate>2010-07-05</domain:curExpDate>
<domain:period unit="y">1</domain:period>
</domain:renew>
@ -57,7 +58,7 @@ RSpec.describe 'EPP domain:renew' do
let!(:registrar) { create(:registrar_with_zero_balance) }
let!(:domain) { create(:domain,
registrar: registrar,
name: 'test.com',
name: 'test.test',
expire_time: Time.zone.parse('05.07.2010'))
}
let(:request_xml) { <<-XML
@ -66,7 +67,7 @@ RSpec.describe 'EPP domain:renew' do
<command>
<renew>
<domain:renew xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
<domain:name>test.com</domain:name>
<domain:name>test.test</domain:name>
<domain:curExpDate>2010-07-04</domain:curExpDate>
<domain:period unit="y">1</domain:period>
</domain:renew>