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.37 spec/bearcat/client/roles_spec.rb
bearcat-1.5.36 spec/bearcat/client/roles_spec.rb
bearcat-1.5.35 spec/bearcat/client/roles_spec.rb
bearcat-1.5.34 spec/bearcat/client/roles_spec.rb
bearcat-1.5.33 spec/bearcat/client/roles_spec.rb
bearcat-1.5.32 spec/bearcat/client/roles_spec.rb
bearcat-1.5.31 spec/bearcat/client/roles_spec.rb
bearcat-1.5.30 spec/bearcat/client/roles_spec.rb
bearcat-1.5.29 spec/bearcat/client/roles_spec.rb
bearcat-1.5.28 spec/bearcat/client/roles_spec.rb
bearcat-1.5.28.beta1 spec/bearcat/client/roles_spec.rb
bearcat-1.5.26 spec/bearcat/client/roles_spec.rb
bearcat-1.5.24 spec/bearcat/client/roles_spec.rb
bearcat-1.5.23 spec/bearcat/client/roles_spec.rb
bearcat-1.5.20 spec/bearcat/client/roles_spec.rb
bearcat-1.5.19 spec/bearcat/client/roles_spec.rb
bearcat-1.5.17 spec/bearcat/client/roles_spec.rb
bearcat-1.5.16 spec/bearcat/client/roles_spec.rb
bearcat-1.5.15 spec/bearcat/client/roles_spec.rb
bearcat-1.5.14 spec/bearcat/client/roles_spec.rb