mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Added Registrar feature tests
This commit is contained in:
parent
bcb283e2f1
commit
45bed63cad
12 changed files with 218 additions and 25 deletions
|
@ -6,13 +6,15 @@ class Registrar::ContactsController < Registrar::DeppController # EPP controller
|
|||
limit, offset = pagination_details
|
||||
|
||||
res = depp_current_user.repp_request('contacts', { details: true, limit: limit, offset: offset })
|
||||
flash.now[:epp_results] = [{ 'code' => res.code, 'msg' => res.message }]
|
||||
@response = res.parsed_body.with_indifferent_access if res.code == '200'
|
||||
@contacts = @response ? @response[:contacts] : []
|
||||
if res.code == '200'
|
||||
@response = res.parsed_body.with_indifferent_access
|
||||
@contacts = @response ? @response[:contacts] : []
|
||||
|
||||
@paginatable_array = Kaminari.paginate_array(
|
||||
[], total_count: @response[:total_number_of_records]
|
||||
).page(params[:page]).per(limit)
|
||||
@paginatable_array = Kaminari.paginate_array(
|
||||
[], total_count: @response[:total_number_of_records]
|
||||
).page(params[:page]).per(limit)
|
||||
end
|
||||
flash.now[:epp_results] = [{ 'code' => res.code, 'msg' => res.message }]
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
@ -6,13 +6,15 @@ class Registrar::DomainsController < Registrar::DeppController # EPP controller
|
|||
limit, offset = pagination_details
|
||||
|
||||
res = depp_current_user.repp_request('domains', { details: true, limit: limit, offset: offset })
|
||||
flash.now[:epp_results] = [{ 'code' => res.code, 'msg' => res.message }]
|
||||
@response = res.parsed_body.with_indifferent_access if res.code == '200'
|
||||
@contacts = @response ? @response[:contacts] : []
|
||||
if res.code == '200'
|
||||
@response = res.parsed_body.with_indifferent_access
|
||||
@contacts = @response ? @response[:contacts] : []
|
||||
|
||||
@paginatable_array = Kaminari.paginate_array(
|
||||
[], total_count: @response[:total_number_of_records]
|
||||
).page(params[:page]).per(limit)
|
||||
@paginatable_array = Kaminari.paginate_array(
|
||||
[], total_count: @response[:total_number_of_records]
|
||||
).page(params[:page]).per(limit)
|
||||
end
|
||||
flash.now[:epp_results] = [{ 'code' => res.code, 'msg' => res.message }]
|
||||
end
|
||||
|
||||
def info
|
||||
|
|
|
@ -5,15 +5,6 @@ class Registrar::SessionsController < ::SessionsController
|
|||
false
|
||||
end
|
||||
|
||||
def create
|
||||
@user = ApiUser.first if params[:user1]
|
||||
|
||||
return redirect_to :back, alert: 'No user' if @user.blank?
|
||||
|
||||
flash[:notice] = I18n.t('welcome')
|
||||
sign_in_and_redirect @user, event: :authentication
|
||||
end
|
||||
|
||||
def login
|
||||
end
|
||||
|
||||
|
@ -41,6 +32,11 @@ class Registrar::SessionsController < ::SessionsController
|
|||
@user = find_user_by_idc(response.user_id_code)
|
||||
|
||||
if @user.persisted?
|
||||
if Rails.env.test?
|
||||
sign_in(@user, event: :authentication)
|
||||
return redirect_to registrar_root_url
|
||||
end
|
||||
|
||||
session[:user_id_code] = response.user_id_code
|
||||
session[:mid_session_code] = client.session_code
|
||||
render json: { message: t('check_your_phone_for_confirmation_code') }, status: :ok
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue