1 require File.dirname(__FILE__) + '/../test_helper'
3 class ClientApplicationTest < ActiveSupport::TestCase
7 # test that tokens can't be found unless they're authorised
9 tok = client_applications(:oauth_web_app).create_request_token
10 assert_equal false, tok.authorized?, "Token should be created unauthorised."
11 assert_equal nil, ClientApplication.find_token(tok.token), "Shouldn't be able to find unauthorised token"
12 tok.authorize!(users(:public_user))
13 assert_equal true, tok.authorized?, "Token should now be authorised."
14 assert_not_equal nil, ClientApplication.find_token(tok.token), "Should be able to find authorised token"