Sha256: 66bc1be61cdce9c99ed94bd473d949770315b70a5ffbb97134df1722935d960c

Contents?: true

Size: 864 Bytes

Versions: 6

Compression:

Stored size: 864 Bytes

Contents

# frozen_string_literal: true

require "test_helper"

class GroupsResourceTest < Minitest::Test
  def test_list
    organization = "https://api.calendly.com/groups/AAAAAAAAAAAAAAAA"
    response = {body: fixture_file("groups/list"), status: 200}
    stub(path: "groups?organization=#{organization}", response: response)

    groups = client.groups.list(organization: organization)

    assert_equal 1, groups.data.size
    assert_instance_of Calendlyr::Group, groups.data.first
  end

  def test_retrieve
    uuid = "abc123"
    response = {body: fixture_file("group_relationships/retrieve"), status: 200}
    stub(path: "group_relationships/#{uuid}", response: response)
    relationship = client.groups.retrieve_relationship(uuid: uuid)

    assert_instance_of Calendlyr::Groups::Relationship, relationship
    assert_equal "member", relationship.role
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
calendlyr-0.7.5 test/calendlyr/resources/groups_test.rb
calendlyr-0.7.4 test/calendlyr/resources/groups_test.rb
calendlyr-0.7.3 test/calendlyr/resources/groups_test.rb
calendlyr-0.7.2 test/calendlyr/resources/groups_test.rb
calendlyr-0.7.1 test/calendlyr/resources/groups_test.rb
calendlyr-0.7.0 test/calendlyr/resources/groups_test.rb