Sha256: badc249cce12ad819efd94d0d938b5836cca206d45c6e5b9eef9667aee06c8c6

Contents?: true

Size: 792 Bytes

Versions: 1

Compression:

Stored size: 792 Bytes

Contents

require 'test_helper'
require 'bearychat/rtm'

class BearychatTest < Minitest::Test
  MOCK_HOOK_URI = 'https://hook.bearychat.com/mock/incoming/hook'

  def test_that_it_has_a_version_number
    refute_nil ::Bearychat::VERSION
  end

  def test_incoming_build_by_module
    assert_equal true, ::Bearychat.incoming(MOCK_HOOK_URI).is_a?(::Bearychat::Incoming)
  end

  def test_incoming_send
    incoming_stub = stub_request(:post, MOCK_HOOK_URI).with(body: hash_including(:text))
    ::Bearychat.incoming(MOCK_HOOK_URI).send
    assert_requested(incoming_stub)
  end

  def test_rtm_send
    rtm_stub = stub_request(:post, Bearychat::RTM::MESSAGE_URL).with(body: hash_including(:token))
    token = 'TOKEN'
    ::Bearychat.rtm(token).send text: 'test'
    assert_requested(rtm_stub)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bearychat-1.0.0 test/bearychat_test.rb