Sha256: ca7929f8c3e47cadce9988649e8d05112f37c8d695d2ec0ea81ce22b2af51c78

Contents?: true

Size: 996 Bytes

Versions: 5

Compression:

Stored size: 996 Bytes

Contents

# frozen_string_literal: true

require_relative "../test_helper"

module Telnyx
  class CommentTest < Test::Unit::TestCase
    should "comment list retrieve" do
      omit "ID req mismatch"
      comments = Comment.list
      assert_requested :get, "#{Telnyx.api_base}/v2/comments"
      assert_kind_of ListObject, comments
      assert_kind_of Telnyx::TelnyxObject, comments.first
    end

    should "comments get by id" do
      comment_id = "12ade33a-21c0-473b-b055-b3c836e1c292"
      comment = Comment.retrieve(comment_id)

      assert_requested :get, "#{Telnyx.api_base}/v2/comments/#{comment_id}"
      assert_kind_of Telnyx::TelnyxObject, comment
    end

    should "comments read" do
      omit "ID req mismatch"
      comment = Comment.retrieve("12ade33a-21c0-473b-b055-b3c836e1c292")
      id = comment.id
      comment.read(name: "new")
      assert_requested :patch, "#{Telnyx.api_base}/v2/comments/#{id}/read"
      assert_kind_of Telnyx::TelnyxObject, comment
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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