spec/bearcat/client/accounts_spec.rb in bearcat-1.0.13 vs spec/bearcat/client/accounts_spec.rb in bearcat-1.0.14

- old
+ new

@@ -3,9 +3,24 @@ describe Bearcat::Client::Accounts do before do @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token") end + it 'returns a list of all the accounts the user belongs to' do + stub_get(@client, "/api/v1/accounts").to_return(json_response("accounts.json")) + accounts = @client.list_accounts + accounts.count.should == 1 + accounts.first['name'].should == 'Local Testing' + end + + it 'returns a list of all of the accounts admins' do + stub_get(@client, "/api/v1/accounts/1/admins").to_return(json_response("account_admins.json")) + account_admins = @client.account_admins(1) + account_admins.count.should == 4 + account_admins.first['id'].should == 3 + account_admins.last['role'].should == 'Custom Admin' + 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"