X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/fa11baf5c348d6eb4ca00d6d15cf9893626fa2d6..406b46e49b786fab879286d77735b2a16c1cfcc5:/vendor/plugins/oauth-plugin/generators/oauth_provider/templates/oauth_nonce_test.rb diff --git a/vendor/plugins/oauth-plugin/generators/oauth_provider/templates/oauth_nonce_test.rb b/vendor/plugins/oauth-plugin/generators/oauth_provider/templates/oauth_nonce_test.rb new file mode 100644 index 000000000..2fd6a755a --- /dev/null +++ b/vendor/plugins/oauth-plugin/generators/oauth_provider/templates/oauth_nonce_test.rb @@ -0,0 +1,26 @@ +require 'oauth/helper' +require File.dirname(__FILE__) + '/../test_helper' + +class ClientNoneTest < ActiveSupport::TestCase + include OAuth::Helper + + def setup + @oauth_nonce = OauthNonce.remember(generate_key,Time.now.to_i) + end + + def test_should_be_valid + assert @oauth_nonce.valid? + end + + def test_should_not_have_errors + assert_equal [], @oauth_nonce.errors.full_messages + end + + def test_should_not_be_a_new_record + assert !@oauth_nonce.new_record? + end + + def test_shuold_not_allow_a_second_one_with_the_same_values + assert_equal false, OauthNonce.remember(@oauth_nonce.nonce, @oauth_nonce.timestamp) + end +end