Sha256: 7f5406c9ede2430297fd0d9e56d3e653b43e12cb8888b0c09753615a5741b465

Contents?: true

Size: 1.44 KB

Versions: 22

Compression:

Stored size: 1.44 KB

Contents

require 'test/unit'
require 'oauth/server'
class ServerTest < Test::Unit::TestCase
  def setup
    @server=OAuth::Server.new "http://test.com"
  end
  
  def test_default_paths
    assert_equal "/oauth/request_token",@server.request_token_path
    assert_equal "/oauth/authorize",@server.authorize_path
    assert_equal "/oauth/access_token",@server.access_token_path
  end
  
  def test_default_urls
    assert_equal "http://test.com/oauth/request_token",@server.request_token_url
    assert_equal "http://test.com/oauth/authorize",@server.authorize_url
    assert_equal "http://test.com/oauth/access_token",@server.access_token_url
  end
  
  def test_generate_consumer_credentials
    consumer=@server.generate_consumer_credentials
    assert_not_nil consumer.key
    assert_not_nil consumer.secret
  end

  def test_create_consumer
    @consumer=@server.create_consumer
    assert_not_nil @consumer
    assert_not_nil @consumer.key
    assert_not_nil @consumer.secret
    assert_equal "http://test.com",@consumer.site
    assert_equal "/oauth/request_token",@consumer.request_token_path
    assert_equal "/oauth/authorize",@consumer.authorize_path
    assert_equal "/oauth/access_token",@consumer.access_token_path
    assert_equal "http://test.com/oauth/request_token",@consumer.request_token_url
    assert_equal "http://test.com/oauth/authorize",@consumer.authorize_url
    assert_equal "http://test.com/oauth/access_token",@consumer.access_token_url
  end  
  
end

Version data entries

22 entries across 22 versions & 7 rubygems

Version Path
mojodna-oauth-0.3.1.1 test/test_server.rb
monkeyhelper-oauth-0.3.1 test/test_server.rb
pelle-oauth-0.2.6 test/test_server.rb
pelle-oauth-0.2.7 test/test_server.rb
pelle-oauth-0.3.0 test/test_server.rb
pelle-oauth-0.3.1 test/test_server.rb
proletarian-oauth-0.3.2 test/test_server.rb
proletarian-oauth-0.3.3 test/test_server.rb
proletarian-oauth-0.3.4 test/test_server.rb
proletarian-oauth-0.3.5 test/test_server.rb
proletarian-oauth-0.3.6 test/test_server.rb
proletarian-oauth-0.3.7 test/test_server.rb
rares-oauth-0.2.7 test/test_server.rb
stmpjmpr-oauth-0.2.7 test/test_server.rb
oauth-0.2.0 test/test_server.rb
oauth-0.2.6 test/test_server.rb
oauth-0.2.1 test/test_server.rb
oauth-0.2.2 test/test_server.rb
oauth-0.2.4 test/test_server.rb
oauth-0.3.1 test/test_server.rb