mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
Move file to another folder
This commit is contained in:
parent
b33ad0d4e8
commit
13562aeb06
1 changed files with 21 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
require 'auth_token/auth_token_creator'
|
||||||
|
|
||||||
class RegistrantApiDomainsTest < ApplicationSystemTestCase
|
class RegistrantApiDomainsTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
|
||||||
|
@ -28,7 +29,24 @@ class RegistrantApiDomainsTest < ApplicationSystemTestCase
|
||||||
assert_equal({errors: ['Domain not found']}, response_json)
|
assert_equal({errors: ['Domain not found']}, response_json)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_get_non_registrar_domain_details_by_uuid
|
def test_root_returns_domain_list
|
||||||
# no op
|
get '/api/v1/registrant/domains', {}, @auth_headers
|
||||||
|
assert_equal(200, response.status)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_root_returns_401_without_authorization
|
||||||
|
get '/api/v1/registrant/domains', {}, {}
|
||||||
|
assert_equal(401, response.status)
|
||||||
|
json_body = JSON.parse(response.body, symbolize_names: true)
|
||||||
|
|
||||||
|
assert_equal({ errors: ['Not authorized'] }, json_body)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def auth_token
|
||||||
|
token_creator = AuthTokenCreator.create_with_defaults(@user)
|
||||||
|
hash = token_creator.token_in_hash
|
||||||
|
"Bearer #{hash[:access_token]}"
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Add table
Add a link
Reference in a new issue