Sha256: 77998c13e98f308465d8a1b8a04deeaf98312470b8f62a05025214e89c54dcd1

Contents?: true

Size: 847 Bytes

Versions: 2

Compression:

Stored size: 847 Bytes

Contents

require 'helper/account'

require 'box/api'
require 'box/account'

describe Box::Account do
  describe "without authorization" do
    before(:each) do
      @account = get_account(false)
    end

    it "fails to authorize without auth token" do
      @account.authorize.should == false
    end

    it "authorizes using auth token" do
      @account.authorize(ACCOUNT['auth_token']).should == true
    end
  end

  describe "with authorization" do
    before(:each) do
      @account = get_account
    end

    # TODO: We need a way to reauthorize automatically, because logout resets the auth token
    #it "can logout" do
    #  @account.logout.should == true
    #end

    it "gets the root folder" do
      @account.root.id.should == 0
    end

    it "caches the root folder" do
      @account.root.should be @account.root
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
box-api-0.1.9 spec/account_spec.rb
box-api-0.1.8 spec/account_spec.rb