File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 99}
1010EOS
1111
12+ UPDATE_WEBHOOK_ENDPOINT = 'https://example.com/hoge'
13+ UPDATE_WEBHOOK_ENDPOINT_CONTENT = <<"EOS"
14+ {
15+ "endpoint": "#{ UPDATE_WEBHOOK_ENDPOINT } "
16+ }
17+ EOS
18+
1219describe Line ::Bot ::Client do
1320 let ( :client ) do
1421 dummy_config = {
3138 active : true
3239 )
3340 end
41+
42+ it 'set webhook endpoint' do
43+ uri_template = Addressable ::Template . new Line ::Bot ::API ::DEFAULT_ENDPOINT + '/bot/channel/webhook/endpoint'
44+ stub_request ( :put , uri_template ) . to_return ( body : '{}' , status : 200 )
45+
46+ client . set_webhook_endpoint ( UPDATE_WEBHOOK_ENDPOINT )
47+ expect ( WebMock ) . to have_requested ( :put , Line ::Bot ::API ::DEFAULT_ENDPOINT + '/bot/channel/webhook/endpoint' )
48+ . with ( body : JSON . parse ( UPDATE_WEBHOOK_ENDPOINT_CONTENT ) . to_json )
49+ end
3450end
You can’t perform that action at this time.
0 commit comments