Add badges to locked domains

This commit is contained in:
Maciej Szlosarczyk 2018-08-09 13:57:31 +03:00
parent 7ce092dff2
commit faeeb55bc7
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
8 changed files with 80 additions and 7 deletions

View file

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