Class: RequestTokenTest
- Inherits:
-
ActiveSupport::TestCase
- Object
- ActiveSupport::TestCase
- RequestTokenTest
- Defined in:
- lib/generators/test_unit/templates/oauth_token_test.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_should_authorize_request ⇒ Object
- #test_should_be_valid ⇒ Object
- #test_should_have_a_secret ⇒ Object
- #test_should_have_a_token ⇒ Object
- #test_should_not_be_authorized ⇒ Object
- #test_should_not_be_invalidated ⇒ Object
- #test_should_not_exchange_without_approval ⇒ Object
- #test_should_not_have_errors ⇒ Object
Instance Method Details
#setup ⇒ Object
7 8 9 |
# 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 ⇒ Object
35 36 37 38 39 40 |
# File 'lib/generators/test_unit/templates/oauth_token_test.rb', line 35 def @token.(users(:quentin)) assert @token. assert_not_nil @token. assert_equal users(:quentin), @token.user end |
#test_should_be_valid ⇒ Object
11 12 13 |
# 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 ⇒ Object
23 24 25 |
# 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 ⇒ Object
19 20 21 |
# 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 ⇒ Object
27 28 29 |
# File 'lib/generators/test_unit/templates/oauth_token_test.rb', line 27 def assert !@token. end |
#test_should_not_be_invalidated ⇒ Object
31 32 33 |
# 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 ⇒ Object
42 43 44 45 |
# 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 ⇒ Object
15 16 17 |
# File 'lib/generators/test_unit/templates/oauth_token_test.rb', line 15 def test_should_not_have_errors assert @token.errors.empty? end |