Sha256: 404221d170f8c50dc9dcae77c2c2089c5e8d2ffff9a9a9079334c31bb512b686
Contents?: true
Size: 1.19 KB
Versions: 27
Compression:
Stored size: 1.19 KB
Contents
require 'test_helper' class NavigationTest < ActionDispatch::IntegrationTest def setup Bot::Adapter::Test.empty_messages end test "notify" do post "/bot/notify" assert_equal 200, status post "/bot/notify", {"messages"=>[{"body"=>"Hello", "readReceiptRequested"=>true, "from"=>"bnmrrs", "timestamp"=>1452785908454, "type"=>"text", "id"=>"2af0d873-d157-4627-b863-8be11b0dfd86"}]} assert_text_response('Hello text!') end test "notify special types" do post "/bot/notify", {"messages"=>[{"body"=>"Hello", "readReceiptRequested"=>true, "from"=>"bnmrrs", "timestamp"=>1452785908454, "type"=>"scan-data", "id"=>"2af0d873-d157-4627-b863-8be11b0dfd86"}]} assert_text_response('Hello scan!') end test "notify multi types" do post "/bot/notify", {"messages"=>[{"body"=>"multi", "readReceiptRequested"=>true, "from"=>"bnmrrs", "timestamp"=>1452785908454, "type"=>"scan-data", "id"=>"2af0d873-d157-4627-b863-8be11b0dfd86"}]} assert_text_response('Hello multi!') end def assert_text_response(message) assert_equal 200, status assert_equal Bot::Adapter::Test.sent_messages.count, 1 assert_equal Bot::Adapter::Test.sent_messages.first["body"], message end end
Version data entries
27 entries across 27 versions & 1 rubygems