Sha256: b813b3e609c1a770034fd270d6f90fbd717b000cb6c92042d8ca9bf65fa9abea

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require_relative "../test_helper"

module Telnyx
  class FaxApplicationTest < Test::Unit::TestCase
    should "fetch index" do
      fax_applications = FaxApplication.list
      assert_requested :get, "#{Telnyx.api_base}/v2/fax_applications"
      assert_kind_of ListObject, fax_applications
      assert_kind_of TelnyxObject, fax_applications.first
    end

    should "create" do
      fax_application = FaxApplication.create application_name: "foo", webhook_event_url: "https://foo.bar.com"
      assert_requested :post, "#{Telnyx.api_base}/v2/fax_applications"
      assert_kind_of TelnyxObject, fax_application
    end

    should "retrieve" do
      fax_application = FaxApplication.retrieve "foo"
      assert_requested :get, "#{Telnyx.api_base}/v2/fax_applications/foo"
      assert_kind_of TelnyxObject, fax_application
    end

    should "delete" do
      fax_application = FaxApplication.retrieve "foo"
      id = fax_application.id.gsub(/\s+/, "+").freeze
      fax_application.delete
      assert_requested :delete, "#{Telnyx.api_base}/v2/fax_applications/#{id}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
telnyx-3.0.5 test/telnyx/fax_application_test.rb
telnyx-3.0.4 test/telnyx/fax_application_test.rb
telnyx-3.0.3 test/telnyx/fax_application_test.rb
telnyx-3.0.2 test/telnyx/fax_application_test.rb
telnyx-3.0.0 test/telnyx/fax_application_test.rb