mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Test fix
This commit is contained in:
parent
53b6734395
commit
d2c31021a9
3 changed files with 32 additions and 8 deletions
|
@ -57,7 +57,7 @@ module Epp::Common
|
|||
|
||||
@errors.uniq!
|
||||
|
||||
render '/epp/error'
|
||||
render_epp_response '/epp/error'
|
||||
end
|
||||
|
||||
def append_errors(obj)
|
||||
|
|
|
@ -8,14 +8,14 @@ module Epp::DomainsHelper
|
|||
if @domain.errors.any? || !@domain.save
|
||||
handle_errors(@domain)
|
||||
else
|
||||
render '/epp/domains/create'
|
||||
render_epp_response '/epp/domains/create'
|
||||
end
|
||||
end
|
||||
|
||||
def check_domain
|
||||
names = parsed_frame.css('name').map(&:text)
|
||||
@domains = Epp::EppDomain.check_availability(names)
|
||||
render '/epp/domains/check'
|
||||
render_epp_response '/epp/domains/check'
|
||||
end
|
||||
|
||||
def renew_domain
|
||||
|
@ -29,7 +29,7 @@ module Epp::DomainsHelper
|
|||
parsed_frame.css('period').first['unit']
|
||||
)
|
||||
|
||||
render '/epp/domains/renew'
|
||||
render_epp_response '/epp/domains/renew'
|
||||
end
|
||||
|
||||
def info_domain
|
||||
|
@ -37,7 +37,7 @@ module Epp::DomainsHelper
|
|||
|
||||
handle_errors(@domain) and return unless @domain
|
||||
|
||||
render '/epp/domains/info'
|
||||
render_epp_response '/epp/domains/info'
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/CyclomaticComplexity
|
||||
|
@ -56,7 +56,7 @@ module Epp::DomainsHelper
|
|||
if @domain.errors.any? || !@domain.save
|
||||
handle_errors(@domain)
|
||||
else
|
||||
render '/epp/domains/success'
|
||||
render_epp_response '/epp/domains/success'
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -93,7 +93,7 @@ module Epp::DomainsHelper
|
|||
end
|
||||
end
|
||||
|
||||
render '/epp/domains/transfer'
|
||||
render_epp_response '/epp/domains/transfer'
|
||||
end
|
||||
|
||||
# rubocop: enable Metrics/MethodLength
|
||||
|
@ -111,7 +111,7 @@ module Epp::DomainsHelper
|
|||
|
||||
handle_errors(@domain) and return unless @domain.destroy
|
||||
|
||||
render '/epp/domains/success'
|
||||
render_epp_response '/epp/domains/success'
|
||||
end
|
||||
# rubocop:enbale Metrics/CyclomaticComplexity
|
||||
|
||||
|
|
|
@ -277,6 +277,30 @@ describe 'EPP Domain', epp: true do
|
|||
expect(response[:result_code]).to eq('1000')
|
||||
expect(domain.legal_documents.count).to eq(1)
|
||||
|
||||
log = ApiLog::EppLog.all
|
||||
|
||||
expect(log.length).to eq(4)
|
||||
expect(log[0].request_command).to eq('hello')
|
||||
expect(log[0].request_successful).to eq(true)
|
||||
|
||||
expect(log[1].request_command).to eq('login')
|
||||
expect(log[1].request_successful).to eq(true)
|
||||
expect(log[1].api_user_name).to eq('elkdata')
|
||||
expect(log[1].api_user_registrar).to eq('Elkdata')
|
||||
|
||||
expect(log[2].request_command).to eq('transfer')
|
||||
expect(log[2].request_object).to eq('domain')
|
||||
expect(log[2].request_successful).to eq(true)
|
||||
expect(log[2].api_user_name).to eq('elkdata')
|
||||
expect(log[2].api_user_registrar).to eq('Elkdata')
|
||||
expect(log[2].request).not_to be_blank
|
||||
expect(log[2].response).not_to be_blank
|
||||
|
||||
expect(log[3].request_command).to eq('logout')
|
||||
expect(log[3].request_successful).to eq(true)
|
||||
expect(log[3].api_user_name).to eq('elkdata')
|
||||
expect(log[3].api_user_registrar).to eq('Elkdata')
|
||||
|
||||
response = epp_request(xml, :xml, :elkdata)
|
||||
expect(response[:result_code]).to eq('1000')
|
||||
expect(domain.legal_documents.count).to eq(1) # does not add another legal document
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue