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