]> git.openstreetmap.org Git - rails.git/blob - vendor/plugins/oauth-plugin/generators/oauth_provider/templates/oauth_nonce_test.rb
Merged 17073:17076 from trunk.
[rails.git] / vendor / plugins / oauth-plugin / generators / oauth_provider / templates / oauth_nonce_test.rb
1 require 'oauth/helper'
2 require File.dirname(__FILE__) + '/../test_helper'
3
4 class ClientNoneTest < ActiveSupport::TestCase
5   include OAuth::Helper
6   
7   def setup
8     @oauth_nonce = OauthNonce.remember(generate_key,Time.now.to_i)
9   end
10
11   def test_should_be_valid
12     assert @oauth_nonce.valid?
13   end
14   
15   def test_should_not_have_errors
16     assert_equal [], @oauth_nonce.errors.full_messages
17   end
18   
19   def test_should_not_be_a_new_record
20     assert !@oauth_nonce.new_record?
21   end
22   
23   def test_shuold_not_allow_a_second_one_with_the_same_values
24     assert_equal false, OauthNonce.remember(@oauth_nonce.nonce, @oauth_nonce.timestamp)
25   end
26 end