Sha256: 56e3a61a3bdac90e25cf626b4716aa972829eeea65404a0e81b9eb5a45a8ad7d

Contents?: true

Size: 809 Bytes

Versions: 49

Compression:

Stored size: 809 Bytes

Contents

require 'helper'

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

  it "returns all roles" do
    stub_get(@client, "/api/v1/accounts/self/roles").to_return(json_response("account_roles.json"))
    roles = @client.roles
    roles.count.should == 1
    roles.first["label"].should == 'Account Admin'
    roles.first["id"].should == 1
    roles.first["base_role_type"].should == 'AccountMembership'
  end

  it "returns an individual role" do
    stub_get(@client, "/api/v1/accounts/self/roles/1").to_return(json_response("account_role.json"))
    role = @client.role(1)
    role["label"].should == 'Account Admin'
    role["id"].should == 1
    role["base_role_type"].should == 'AccountMembership'
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
bearcat-1.5.13 spec/bearcat/client/roles_spec.rb
bearcat-1.5.12 spec/bearcat/client/roles_spec.rb
bearcat-1.5.11 spec/bearcat/client/roles_spec.rb
bearcat-1.5.10 spec/bearcat/client/roles_spec.rb
bearcat-1.5.9 spec/bearcat/client/roles_spec.rb
bearcat-1.5.8 spec/bearcat/client/roles_spec.rb
bearcat-1.5.7 spec/bearcat/client/roles_spec.rb
bearcat-1.5.6 spec/bearcat/client/roles_spec.rb
bearcat-1.5.5 spec/bearcat/client/roles_spec.rb
bearcat-1.5.4 spec/bearcat/client/roles_spec.rb
bearcat-1.5.3 spec/bearcat/client/roles_spec.rb
bearcat-1.5.2 spec/bearcat/client/roles_spec.rb
bearcat-1.5.0 spec/bearcat/client/roles_spec.rb
bearcat-1.5.0.beta4 spec/bearcat/client/roles_spec.rb
bearcat-1.5.0.beta3 spec/bearcat/client/roles_spec.rb
bearcat-1.5.0.beta2 spec/bearcat/client/roles_spec.rb
bearcat-1.5.0.beta1 spec/bearcat/client/roles_spec.rb
bearcat-1.4.13 spec/bearcat/client/roles_spec.rb
bearcat-1.4.12 spec/bearcat/client/roles_spec.rb
bearcat-1.4.11 spec/bearcat/client/roles_spec.rb