mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
Add badges to locked domains
This commit is contained in:
parent
7ce092dff2
commit
faeeb55bc7
8 changed files with 80 additions and 7 deletions
|
@ -0,0 +1,28 @@
|
|||
require 'test_helper'
|
||||
require 'auth_token/auth_token_creator'
|
||||
|
||||
class RegistrantApiDomainRegistryLockTest < ApplicationIntegrationTest
|
||||
def setup
|
||||
super
|
||||
|
||||
@user = users(:registrant)
|
||||
@domain = domains(:airport)
|
||||
@auth_headers = { 'HTTP_AUTHORIZATION' => auth_token }
|
||||
end
|
||||
|
||||
def test_can_lock_a_not_locked_domain
|
||||
assert(@domain.locked_by_registrant?)
|
||||
end
|
||||
|
||||
def test_cannot_lock_an_already_locked_domain
|
||||
assert(@domain.locked_by_registrant?)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def auth_token
|
||||
token_creator = AuthTokenCreator.create_with_defaults(@user)
|
||||
hash = token_creator.token_in_hash
|
||||
"Bearer #{hash[:access_token]}"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue