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