Fix tests

This commit is contained in:
Karl Erik Õunapuu 2020-10-15 10:23:50 +03:00
parent 27774cc275
commit a6f7af0f03
No known key found for this signature in database
GPG key ID: C9DD647298A34764
8 changed files with 35 additions and 26 deletions

View file

@ -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

View file

@ -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

View file

@ -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