Class: ClientApplicationTest

Inherits:
ActiveSupport::TestCase
  • Object
show all
Includes:
OAuthHelpers
Defined in:
lib/generators/test_unit/templates/client_application_test.rb

Instance Method Summary collapse

Methods included from OAuthHelpers

#create_consumer

Instance Method Details

#setupObject



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_validObject



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_credentialsObject



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_secretObject



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_errorsObject



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.full_messages
end