mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 16:32:04 +02:00
Fix tests
This commit is contained in:
parent
27774cc275
commit
a6f7af0f03
8 changed files with 35 additions and 26 deletions
|
@ -15,12 +15,12 @@ class Registrar
|
|||
csv.each do |row|
|
||||
domain_name = row['Domain']
|
||||
transfer_code = row['Transfer code']
|
||||
domain_transfers << { 'domainName' => domain_name, 'transferCode' => transfer_code }
|
||||
domain_transfers << { 'domain_name' => domain_name, 'transfer_code' => transfer_code }
|
||||
end
|
||||
|
||||
uri = URI.parse("#{ENV['repp_url']}domain_transfers")
|
||||
uri = URI.parse("#{ENV['repp_url']}domains/transfer")
|
||||
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
||||
request.body = { data: { domainTransfers: domain_transfers } }.to_json
|
||||
request.body = { data: { domain_transfers: domain_transfers } }.to_json
|
||||
request.basic_auth(current_registrar_user.username,
|
||||
current_registrar_user.plain_text_password)
|
||||
|
||||
|
|
|
@ -82,6 +82,8 @@ module Repp
|
|||
|
||||
return if @current_user
|
||||
|
||||
render(json: { errors: [{ base: ['Not authorized'] }] }, status: :unauthorized)
|
||||
rescue NoMethodError
|
||||
render(json: { errors: [{ base: ['Not authorized'] }] }, status: :unauthorized)
|
||||
end
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ module Repp
|
|||
if @errors.any?
|
||||
render_success(data: { errors: @errors })
|
||||
else
|
||||
render_success(data: successful)
|
||||
render_success(data: @successful)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ module Repp
|
|||
|
||||
def hostname_params
|
||||
params.require(:data).require(%i[type id])
|
||||
params.require(:data).require(:attributes).require(%i[hostname ipv4 ipv6])
|
||||
params.require(:data).require(:attributes)
|
||||
|
||||
params.permit(data: [:type, :id, attributes: [:hostname, ipv4: [], ipv6: []]])
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue