3 class OauthTokenTest < ActiveSupport::TestCase
7 # check that after calling invalidate! on a token, it is invalid.
8 def test_token_invalidation
10 assert_equal false, tok.invalidated?, "Token should be created valid."
12 assert_equal true, tok.invalidated?, "Token should now be invalid."
16 # check that an authorized token is authorised and can be invalidated
17 def test_token_authorisation
18 tok = RequestToken.create(:client_application => create(:client_application))
19 assert_equal false, tok.authorized?, "Token should be created unauthorised."
20 tok.authorize!(users(:public_user))
21 assert_equal true, tok.authorized?, "Token should now be authorised."
23 assert_equal false, tok.authorized?, "Token should now be invalid."