Create base controller class

This commit is contained in:
Maciej Szlosarczyk 2018-07-23 16:23:56 +03:00
parent 65676ae637
commit 8f234a5852
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
5 changed files with 67 additions and 23 deletions

View file

@ -35,6 +35,11 @@ class AuthTokenDecryptorTest < ActiveSupport::TestCase
refute(faulty_decryptor.decrypt_token)
end
def test_decrypt_token_return_false_when_token_is_nil
faulty_decryptor = AuthTokenDecryptor.new(nil, @key)
refute(faulty_decryptor.decrypt_token)
end
def test_valid_returns_true_for_valid_token
decryptor = AuthTokenDecryptor.new(@access_token, @key)
decryptor.decrypt_token