Sha256: 7097cb2d90b4e704962a423f5eaad1e10c6c324a059de50222cfd58f235f646b

Contents?: true

Size: 751 Bytes

Versions: 11

Compression:

Stored size: 751 Bytes

Contents

require 'helper'

describe Bearcat::Client::Accounts do
  before do
    @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token")
  end

  it "returns a single account" do
    stub_get(@client, "/api/v1/accounts/1").to_return(json_response("single_account.json"))
    account = @client.account(1)
    account["id"].should == 1
    account["name"].should == "Local Testing"
  end

  it "returns enrollment terms for an account" do
    stub_get(@client, "/api/v1/accounts/1/terms").to_return(json_response("enrollment_terms.json"))
    account = @client.terms(1)
    terms = account['enrollment_terms']
    terms.count.should == 1
    terms.first['id'].should == 4
    terms.first['name'].should == 'Term 1'
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bearcat-1.0.1 spec/bearcat/client/accounts_spec.rb
bearcat-1.0.0 spec/bearcat/client/accounts_spec.rb
bearcat-0.9.22 spec/bearcat/client/accounts_spec.rb
bearcat-0.9.20 spec/bearcat/client/accounts_spec.rb
bearcat-0.9.19 spec/bearcat/client/accounts_spec.rb
bearcat-0.9.18 spec/bearcat/client/accounts_spec.rb
bearcat-0.9.17 spec/bearcat/client/accounts_spec.rb
bearcat-0.9.16 spec/bearcat/client/accounts_spec.rb
bearcat-0.9.15 spec/bearcat/client/accounts_spec.rb
bearcat-0.9.14 spec/bearcat/client/accounts_spec.rb
bearcat-0.9.13 spec/bearcat/client/accounts_spec.rb