Sha256: 08608ce38d1db8f2191a958171bf19f31c0a822122db34b718676f7043687325
Contents?: true
Size: 1.15 KB
Versions: 2
Compression:
Stored size: 1.15 KB
Contents
require 'helper' describe Bearcat::Client::Users do before do @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token") end it "returns all users for an account" do stub_get(@client, "/api/v1/accounts/1/users").to_return(json_response("account_users.json")) users = @client.list_users(1) users.count.should == 3 users.last['id'].should == 3 users.first['id'].should == 1 users.first['name'].should == 'test user 1' end it "returns a user in an account if a search term is provided" do stub_get(@client, "/api/v1/accounts/1/users?search_term=testusersisid1").to_return(json_response("account_user.json")) user = @client.list_users(1, {"search_term" => "testusersisid1"}) user.count.should == 1 user.first['name'].should == 'test user 1' user.first['sis_user_id'].should == 'testusersisid1' end it "returns the possible user avatar options" do stub_get(@client, "/api/v1/users/1/avatars").to_return(json_response("user_avatars.json")) user_avatars = @client.user_avatars(1) user_avatars.count.should == 2 user_avatars.first['type'].should == 'gravatar' end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bearcat-0.9.2 | spec/bearcat/client/users_spec.rb |
bearcat-0.9.1 | spec/bearcat/client/users_spec.rb |