spec/bearcat/client/accounts_spec.rb in bearcat-1.0.23 vs spec/bearcat/client/accounts_spec.rb in bearcat-1.0.24
- old
+ new
@@ -37,14 +37,22 @@
end
it "returns the roles for an account" do
stub_get(@client, "/api/v1/accounts/1/roles").to_return(json_response("account_roles.json"))
account = @client.account_roles(1)
- roles = account.members
+ roles = account.members
roles.count.should == 1
roles.first['id'].should == 1
roles.first['role'].should == 'AccountAdmin'
roles.first['permissions'].count.should == 4
roles.first['permissions']['manage_catalog']['enabled'].should == true
- end
+ end
+
+ it 'returns courses for an account' do
+ stub_get(@client, "/api/v1/accounts/1/courses").to_return(json_response("account_courses.json"))
+ courses = @client.account_courses(1)
+ courses.count.should == 2
+ courses.first['id'].should == 1
+ courses.first['name'].should == 'Sub1 Course1'
+ end
end