test/bearychat_test.rb in bearychat-0.1.1 vs test/bearychat_test.rb in bearychat-1.0.0

- old
+ new

@@ -1,6 +1,7 @@ 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 @@ -10,10 +11,17 @@ 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(:payload)) + 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