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 9
9
}
10
10
EOS
11
11
12
+ UPDATE_WEBHOOK_ENDPOINT = 'https://example.com/hoge'
13
+ UPDATE_WEBHOOK_ENDPOINT_CONTENT = <<"EOS"
14
+ {
15
+ "endpoint": "#{ UPDATE_WEBHOOK_ENDPOINT } "
16
+ }
17
+ EOS
18
+
12
19
describe Line ::Bot ::Client do
13
20
let ( :client ) do
14
21
dummy_config = {
31
38
active : true
32
39
)
33
40
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
34
50
end
You can’t perform that action at this time.
0 commit comments