Sha256: 3e7e7db3791cd6d80612e64758a21551e6b132462832349df2469da6b633fceb

Contents?: true

Size: 802 Bytes

Versions: 6

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true

require "test_helper"

class RoutingFormObjectTest < Minitest::Test
  def setup
    json = JSON.parse(fixture_file("objects/routing_form")).merge(client: client)
    @routing_form = Calendlyr::RoutingForm.new(json)
  end

  def test_associated_organization
    organization = @routing_form.associated_organization

    assert_instance_of Calendlyr::Organization, organization
  end

  def test_submissions
    response = {body: fixture_file("routing_forms/list_routing_form_submission"), status: 200}
    stub(path: "routing_form_submissions?form=#{@routing_form.uri}", response: response)

    submissions = @routing_form.submissions

    assert_equal 1, submissions.data.size
    assert_instance_of Calendlyr::RoutingForms::Submission, submissions.data.first
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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