spec/bearcat/client/groups_spec.rb in bearcat-1.2.9 vs spec/bearcat/client/groups_spec.rb in bearcat-1.2.10

- old
+ new

@@ -18,6 +18,22 @@ groups = @client.account_groups(1) groups.count.should == 2 groups.first['name'].should == '2010' groups.last['id'].should == 3 end + + it "returns a single group" do + stub_get(@client, "/api/v1/groups/3").to_return(json_response("group.json")) + group = @client.group(3) + group['name'].should == 'group 1' + group['id'].should == 3 + end + + it "creates a group" do + name = 'created group 1' + stub_post(@client, "/api/v1/group_categories/2/groups").with(body: { name: name }).to_return(json_response("created_group.json")) + created_group = @client.create_group(2, { name: name }) + created_group['name'] == 'created group 1' + created_group['context_type'] == 'Course' + created_group['group_category']['id'] == 2 + end end \ No newline at end of file