Class: ClientNoneTest

Inherits:
ActiveSupport::TestCase
  • Object
show all
Includes:
OAuth::Helper
Defined in:
lib/generators/test_unit/templates/oauth_nonce_test.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



7
8
9
# File 'lib/generators/test_unit/templates/oauth_nonce_test.rb', line 7

def setup
  @oauth_nonce = OauthNonce.remember(generate_key,Time.now.to_i)
end

#test_should_be_validObject



11
12
13
# File 'lib/generators/test_unit/templates/oauth_nonce_test.rb', line 11

def test_should_be_valid
  assert @oauth_nonce.valid?
end

#test_should_not_be_a_new_recordObject



19
20
21
# File 'lib/generators/test_unit/templates/oauth_nonce_test.rb', line 19

def test_should_not_be_a_new_record
  assert !@oauth_nonce.new_record?
end

#test_should_not_have_errorsObject



15
16
17
# File 'lib/generators/test_unit/templates/oauth_nonce_test.rb', line 15

def test_should_not_have_errors
  assert_equal [], @oauth_nonce.errors.full_messages
end

#test_shuold_not_allow_a_second_one_with_the_same_valuesObject



23
24
25
# File 'lib/generators/test_unit/templates/oauth_nonce_test.rb', line 23

def test_shuold_not_allow_a_second_one_with_the_same_values
  assert_equal false, OauthNonce.remember(@oauth_nonce.nonce, @oauth_nonce.timestamp)
end