Sha256: 8a3d42dff8c56c0207af9d7a2e1625c94d8a76436b7d01c6e488376fda622ecc

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

require "test_helper"

class GroupObjectTest < Minitest::Test
  def setup
    json = JSON.parse(fixture_file("objects/group")).merge(client: client)
    @group = Calendlyr::Group.new(json)

    @start_time = "2020-01-02T20:00:00.000000Z"
    @end_time = "2020-01-07T24:00:00.000000Z"

    group_uri = "https://api.calendly.com/groups/AAAAAAAAAAAAAAAA"
    response = {body: fixture_file("events/list"), status: 200}
    stub(path: "scheduled_events?group=#{group_uri}", response: response)

    response = {body: fixture_file("group_relationships/list"), status: 200}
    stub(path: "group_relationships?group=#{group_uri}", response: response)
  end

  def test_associated_organization
    organization = @group.associated_organization

    assert_equal Calendlyr::Organization, organization.class
  end

  def test_events
    events = @group.events

    assert_equal 1, events.data.size
    assert_equal Calendlyr::Event, events.data.first.class
  end

  def test_group_relationships
    group_relationships = @group.group_relationships

    assert_equal 3, group_relationships.data.size
    assert_equal Calendlyr::Groups::Relationship, group_relationships.data.first.class
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
calendlyr-0.7.5 test/calendlyr/objects/group_test.rb
calendlyr-0.7.4 test/calendlyr/objects/group_test.rb
calendlyr-0.7.3 test/calendlyr/objects/group_test.rb
calendlyr-0.7.2 test/calendlyr/objects/group_test.rb
calendlyr-0.7.1 test/calendlyr/objects/group_test.rb
calendlyr-0.7.0 test/calendlyr/objects/group_test.rb