Sha256: 81d1500facf2365dcfe2d6b176af673509aa26d65e69c1971e9a1b48979441fe

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require 'test_helper'

class TestTest < Test::Unit::TestCase

  context "vimeo advanced test" do
    
    setup do
      @test = Vimeo::Advanced::Test.new("12345", "secret")
    end

    should "be able to get an echo" do
      stub_post("?api_key=12345&format=json&api_sig=6f913caf4fd018a0dd48400f6ac07439&method=vimeo.test.echo", "advanced/test/echo.json")
      response = @test.echo
      
      assert_equal "ok", response["stat"]
    end
    
    should "be able to test if a user is logged in" do
      stub_post("?api_key=12345&auth_token=token&format=json&api_sig=9753d04b7b5b3c47101aace3f314ed84&method=vimeo.test.login", "advanced/test/login.json")
      response = @test.login("token")
      
      assert_equal "matthooks", response["user"]["username"]
    end
    
    should "be able to ping the Vimeo advanced API" do
      stub_post("?api_key=12345&auth_token=token&format=json&api_sig=5f45b34d1e7078636f5386b8db7408ee&method=vimeo.test.null", "advanced/test/null.json")
      response = @test.null("token")
      
      assert_equal "ok", response["stat"]
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vimeo-1.0.0 test/vimeo/advanced/test_test.rb