class RequestTokenTest

Public Instance Methods

setup() click to toggle source
# File lib/generators/test_unit/templates/oauth_token_test.rb, line 7
def setup
  @token = RequestToken.create :client_application=>client_applications(:one)
end
test_should_authorize_request() click to toggle source
# File lib/generators/test_unit/templates/oauth_token_test.rb, line 35
def test_should_authorize_request
  @token.authorize!(users(:quentin))
  assert @token.authorized?
  assert_not_nil @token.authorized_at
  assert_equal users(:quentin), @token.user
end
test_should_be_valid() click to toggle source
# File lib/generators/test_unit/templates/oauth_token_test.rb, line 11
def test_should_be_valid
  assert @token.valid?
end
test_should_have_a_secret() click to toggle source
# File lib/generators/test_unit/templates/oauth_token_test.rb, line 23
def test_should_have_a_secret
  assert_not_nil @token.secret
end
test_should_have_a_token() click to toggle source
# File lib/generators/test_unit/templates/oauth_token_test.rb, line 19
def test_should_have_a_token
  assert_not_nil @token.token
end
test_should_not_be_authorized() click to toggle source
# File lib/generators/test_unit/templates/oauth_token_test.rb, line 27
def test_should_not_be_authorized
  assert !@token.authorized?
end
test_should_not_be_invalidated() click to toggle source
# File lib/generators/test_unit/templates/oauth_token_test.rb, line 31
def test_should_not_be_invalidated
  assert !@token.invalidated?
end
test_should_not_exchange_without_approval() click to toggle source
# File lib/generators/test_unit/templates/oauth_token_test.rb, line 42
def test_should_not_exchange_without_approval
  assert_equal false, @token.exchange!
  assert_equal false, @token.invalidated?
end
test_should_not_have_errors() click to toggle source
# File lib/generators/test_unit/templates/oauth_token_test.rb, line 15
def test_should_not_have_errors
  assert @token.errors.empty?
end