changed response

This commit is contained in:
Oleg Hasjanov 2021-07-28 14:47:43 +03:00 committed by olegphenomenon
parent 68ff1c1e64
commit 36e9aac1d3
2 changed files with 3 additions and 4 deletions

View file

@ -6,7 +6,7 @@ module Repp
desc 'check login user and return data'
def index
@login = current_user.registrar
@login = current_user
# rubocop:disable Style/AndOr
render_success(data: nil) and return unless @login

View file

@ -3,7 +3,6 @@ require 'test_helper'
class ReppV1LoginTest < ActionDispatch::IntegrationTest
def setup
@user = users(:api_bestnames)
@registrar = @user.registrar
token = Base64.encode64("#{@user.username}:#{@user.plain_text_password}")
token = "Basic #{token}"
@ -15,8 +14,8 @@ class ReppV1LoginTest < ActionDispatch::IntegrationTest
json = JSON.parse(response.body, symbolize_names: true)
assert_response :ok
assert_equal json[:data][:email], @registrar.email
assert_equal json[:data][:id], @registrar.id
assert_equal json[:data][:username], @user.username
assert_equal json[:data][:identity_code], @user.identity_code
end
def test_invalid_login