Sha256: 2a8faaab18a8a5a5d81b2a5b100666a56043b7c09696f1f67cd67a2f06bca469

Contents?: true

Size: 879 Bytes

Versions: 3

Compression:

Stored size: 879 Bytes

Contents

# frozen_string_literal: true

require_relative "../test_helper"
module Telnyx
  class FaxTest < Test::Unit::TestCase
    should "fetch index" do
      faxes = Fax.list
      assert_requested :get, "#{Telnyx.api_base}/v2/faxes"
      assert_kind_of ListObject, faxes
      assert_kind_of Fax, faxes.first
    end

    should "send fax" do
      fax = Fax.create connection_id: "foo", media_url: "example.com", to: "+13127367276"
      assert_requested :post, "#{Telnyx.api_base}/v2/faxes"
      assert_kind_of Fax, fax
    end

    should "view fax" do
      fax = Fax.retrieve "foo"
      assert_requested :get, "#{Telnyx.api_base}/v2/faxes/foo"
      assert_kind_of Fax, fax
    end

    should "delete fax" do
      omit "!!waiting for mock!!"
      fax = Fax.retrieve "foo"
      fax.delete
      assert_requested :delete, "#{Telnyx.api_base}/v2/faxes/foo"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
telnyx-2.6.0 test/telnyx/fax_test.rb
telnyx-2.5.0 test/telnyx/fax_test.rb
telnyx-2.4.0 test/telnyx/fax_test.rb