require 'helper' describe Bearcat::Client::GroupMemberships do before do @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token") end it "creates a group membership" do stub_post(@client, "/api/v1/groups/3/memberships").with(:body => {"user_id"=>"6"}).to_return(json_response("created_group_membership.json")) created_group_membership = @client.create_group_membership(3, { user_id: 6 }) created_group_membership['id'] == 14 created_group_membership['group_id'] == 3 created_group_membership['workflow_state'] == 'accepted' created_group_membership['user_id'] == 6 end end