mirror of
https://github.com/internetee/registry.git
synced 2025-08-12 20:49:36 +02:00
Return more data after domain create
This commit is contained in:
parent
f87a7fa912
commit
bb78c0f581
3 changed files with 32 additions and 5 deletions
|
@ -6,7 +6,7 @@ module Epp::DomainsHelper
|
||||||
handle_errors(@domain) and return unless @domain.parse_and_attach_domain_dependencies(@ph, parsed_frame)
|
handle_errors(@domain) and return unless @domain.parse_and_attach_domain_dependencies(@ph, parsed_frame)
|
||||||
handle_errors(@domain) and return unless @domain.save
|
handle_errors(@domain) and return unless @domain.save
|
||||||
|
|
||||||
render '/epp/domains/success'
|
render '/epp/domains/create'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
17
app/views/epp/domains/create.xml.builder
Normal file
17
app/views/epp/domains/create.xml.builder
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
xml.epp_head do
|
||||||
|
xml.response do
|
||||||
|
xml.result('code' => '1000') do
|
||||||
|
xml.msg 'Command completed successfully'
|
||||||
|
end
|
||||||
|
|
||||||
|
xml.resData do
|
||||||
|
xml.tag!('domain:creData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do
|
||||||
|
xml.tag!('domain:name', @domain.name)
|
||||||
|
xml.tag!('domain:crDate', @domain.created_at)
|
||||||
|
xml.tag!('domain:exDate', @domain.valid_to)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
xml << render('/epp/shared/trID')
|
||||||
|
end
|
|
@ -38,15 +38,25 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
it 'creates a domain' do
|
it 'creates a domain' do
|
||||||
response = epp_request(domain_create_xml, :xml)
|
response = epp_request(domain_create_xml, :xml)
|
||||||
|
|
||||||
|
d = Domain.first
|
||||||
|
|
||||||
expect(response[:result_code]).to eq('1000')
|
expect(response[:result_code]).to eq('1000')
|
||||||
expect(response[:msg]).to eq('Command completed successfully')
|
expect(response[:msg]).to eq('Command completed successfully')
|
||||||
|
|
||||||
|
cre_data = response[:parsed].css('creData')
|
||||||
|
|
||||||
|
expect(cre_data.css('name').text).to eq('example.ee')
|
||||||
|
expect(cre_data.css('crDate').text).to eq(d.created_at.to_time.utc.to_s)
|
||||||
|
expect(cre_data.css('exDate').text).to eq(d.valid_to.to_time.utc.to_s)
|
||||||
|
|
||||||
expect(response[:clTRID]).to eq('ABC-12345')
|
expect(response[:clTRID]).to eq('ABC-12345')
|
||||||
|
|
||||||
expect(Domain.first.registrar.name).to eq('Zone Media OÜ')
|
expect(d.registrar.name).to eq('Zone Media OÜ')
|
||||||
expect(Domain.first.tech_contacts.count).to eq 2
|
expect(d.tech_contacts.count).to eq 2
|
||||||
expect(Domain.first.admin_contacts.count).to eq 1
|
expect(d.admin_contacts.count).to eq 1
|
||||||
|
|
||||||
expect(Domain.first.nameservers.count).to eq(2)
|
expect(d.nameservers.count).to eq(2)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not create duplicate domain' do
|
it 'does not create duplicate domain' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue