File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,14 @@ def get_user_rich_menu(user_id)
310
310
get ( endpoint_path )
311
311
end
312
312
313
+ # Get default rich menu
314
+ #
315
+ # @return [Net::HTTPResponse]
316
+ def get_default_rich_menu
317
+ endpoint_path = '/bot/user/all/richmenu'
318
+ get ( endpoint_path )
319
+ end
320
+
313
321
# Set default rich menu (Link a rich menu to all user)
314
322
#
315
323
# @param rich_menu_id [String] ID of an uploaded rich menu
Original file line number Diff line number Diff line change 103
103
expect ( WebMock ) . to have_requested ( :post , Line ::Bot ::API ::DEFAULT_ENDPOINT + '/bot/user/all/richmenu/7654321' )
104
104
end
105
105
106
+ it 'get the default rich menu' do
107
+ uri_template = Addressable ::Template . new Line ::Bot ::API ::DEFAULT_ENDPOINT + '/bot/user/all/richmenu'
108
+ stub_request ( :get , uri_template ) . to_return ( body : '{"richMenuId":"76543210"}' , status : 200 )
109
+
110
+ response = client . get_default_rich_menu
111
+ expect ( WebMock ) . to have_requested ( :get , Line ::Bot ::API ::DEFAULT_ENDPOINT + '/bot/user/all/richmenu' )
112
+ expect ( response . body ) . to eq '{"richMenuId":"76543210"}'
113
+ end
114
+
106
115
it 'unset a default rich menu' do
107
116
uri_template = Addressable ::Template . new Line ::Bot ::API ::DEFAULT_ENDPOINT + '/bot/user/all/richmenu'
108
117
stub_request ( :delete , uri_template ) . to_return ( body : '{}' , status : 200 )
You can’t perform that action at this time.
0 commit comments