Sha256: 28b408cb3ebdc56f63270d9e02484e174011917bf835897ae3bc3f2fcb01adc5

Contents?: true

Size: 899 Bytes

Versions: 13

Compression:

Stored size: 899 Bytes

Contents

require 'test_helper'

class AuthTest < Test::Unit::TestCase
  
  TOKEN = "12345"
  SECRET = "secret"

  context "vimeo advanced" do
    
    setup do
      @auth = Vimeo::Advanced::Base.new(TOKEN, SECRET)
    end
    
    should "recieve a valid OAuth url" do
      stub_custom_get("/oauth/request_token", "advanced/auth/request_token.txt")
      token = @auth.get_request_token
      assert_equal true, token.callback_confirmed?
      assert_equal "http://vimeo.com/oauth/authorize?oauth_token=#{TOKEN}", token.authorize_url
    end

    should "receive the user's credentials after checking the OAuth token" do
      stub_custom_get("/oauth/access_token", "advanced/auth/access_token.txt")
      stub_post("", "advanced/auth/check_access_token.json")
      auth = @auth.check_access_token
      assert_equal "token", auth["token"]
      assert_equal "write", auth["permission"]
    end

  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
vimeo-1.5.3 test/vimeo/advanced/auth_test.rb
slainer68_vimeo-1.5.2 test/vimeo/advanced/auth_test.rb
vimeo-1.5.2 test/vimeo/advanced/auth_test.rb
vimeo-1.5.1 test/vimeo/advanced/auth_test.rb
vimeo-1.5.0 test/vimeo/advanced/auth_test.rb
slainer68_vimeo-1.4.4 test/vimeo/advanced/auth_test.rb
slainer68_vimeo-1.4.3 test/vimeo/advanced/auth_test.rb
vimeo-1.4.3 test/vimeo/advanced/auth_test.rb
vimeo-1.4.2 test/vimeo/advanced/auth_test.rb
vimeo-1.4.1 test/vimeo/advanced/auth_test.rb
vimeo-1.4.0 test/vimeo/advanced/auth_test.rb
vimeo-1.3.0 test/vimeo/advanced/auth_test.rb
vimeo-1.2.2 test/vimeo/advanced/auth_test.rb