Class: ClientApplicationTest
- Inherits:
-
ActiveSupport::TestCase
- Object
- ActiveSupport::TestCase
- ClientApplicationTest
- Includes:
- OAuthHelpers
- Defined in:
- lib/generators/test_unit/templates/client_application_test.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_should_be_valid ⇒ Object
- #test_should_have_credentials ⇒ Object
- #test_should_have_key_and_secret ⇒ Object
- #test_should_not_have_errors ⇒ Object
Methods included from OAuthHelpers
Instance Method Details
#setup ⇒ Object
17 18 19 20 |
# File 'lib/generators/test_unit/templates/client_application_test.rb', line 17 def setup @application = ClientApplication.create :name=>"Agree2",:url=>"http://agree2.com",:user=>users(:quentin) create_consumer end |
#test_should_be_valid ⇒ Object
22 23 24 |
# File 'lib/generators/test_unit/templates/client_application_test.rb', line 22 def test_should_be_valid assert @application.valid? end |
#test_should_have_credentials ⇒ Object
36 37 38 39 40 |
# File 'lib/generators/test_unit/templates/client_application_test.rb', line 36 def test_should_have_credentials assert_not_nil @application.credentials assert_equal @application.key, @application.credentials.key assert_equal @application.secret, @application.credentials.secret end |
#test_should_have_key_and_secret ⇒ Object
31 32 33 34 |
# File 'lib/generators/test_unit/templates/client_application_test.rb', line 31 def test_should_have_key_and_secret assert_not_nil @application.key assert_not_nil @application.secret end |
#test_should_not_have_errors ⇒ Object
27 28 29 |
# File 'lib/generators/test_unit/templates/client_application_test.rb', line 27 def test_should_not_have_errors assert_equal [], @application.errors. end |