message_test.rb 550 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. require 'test_helper'
  3. class PingMessageTest < Test::Unit::TestCase
  4. def test_create_message
  5. fake("api/ping-api/v1/conversations/123/messages",
  6. method: :post,
  7. body: load_fixture('ping/message'))
  8. message = ShopifyAPI::Ping::Message.new(
  9. dedupe_key: SecureRandom.uuid,
  10. content: {
  11. text: "Hello from shopify_api",
  12. },
  13. sender_id: 'test',
  14. conversation_id: '123',
  15. )
  16. message.save
  17. assert_equal("d0c7a2e6-8084-4e79-8483-e4a1352b81f7", message.id)
  18. end
  19. end