|
178 | 178 | end |
179 | 179 | end |
180 | 180 |
|
| 181 | + describe 'PUT /liff/v1/apps/{liffId}' do |
| 182 | + let(:client) { Line::Bot::V2::Liff::ApiClient.new(channel_access_token: 'test-channel-access-token') } |
| 183 | + let(:response_body) { "" } # not empty json, but empty string |
| 184 | + let(:response_code) { 200 } |
| 185 | + |
| 186 | + it 'empty response body should not throw error' do |
| 187 | + stub_request(:put, "https://api.line.me/liff/v1/apps/test-liff-id") |
| 188 | + .with( |
| 189 | + headers: { |
| 190 | + 'Authorization' => "Bearer test-channel-access-token" |
| 191 | + } |
| 192 | + ) |
| 193 | + .to_return(status: response_code, body: response_body, headers: { }) |
| 194 | + |
| 195 | + request = Line::Bot::V2::Liff::UpdateLiffAppRequest.new(view: { url: 'https://example.com' }) |
| 196 | + body, status_code, _ = client.update_liff_app_with_http_info(liff_id: 'test-liff-id', update_liff_app_request: request) |
| 197 | + |
| 198 | + expect(status_code).to eq(200) |
| 199 | + expect(body).to eq("") |
| 200 | + end |
| 201 | + end |
| 202 | + |
| 203 | + describe 'POST /v2/bot/message/broadcast' do |
| 204 | + let(:client) { Line::Bot::V2::MessagingApi::ApiClient.new(channel_access_token: 'test-channel-access-token') } |
| 205 | + let(:response_body) { { }.to_json } # empty json |
| 206 | + let(:response_code) { 200 } |
| 207 | + |
| 208 | + it 'empty json as response body should not throw error' do |
| 209 | + stub_request(:post, "https://api.line.me/v2/bot/message/broadcast") |
| 210 | + .with( |
| 211 | + headers: { |
| 212 | + 'Authorization' => "Bearer test-channel-access-token" |
| 213 | + } |
| 214 | + ) |
| 215 | + .to_return(status: response_code, body: response_body, headers: { 'Content-Type' => 'application/json' }) |
| 216 | + |
| 217 | + body, status_code, _ = client.broadcast_with_http_info(broadcast_request: { type: 'text', text: 'Hello, world!' }) |
| 218 | + |
| 219 | + expect(status_code).to eq(200) |
| 220 | + expect(body).to eq("{}") |
| 221 | + end |
| 222 | + end |
| 223 | + |
181 | 224 | describe 'GET /v2/bot/message/aggregation/list' do |
182 | 225 | let(:client) { Line::Bot::V2::MessagingApi::ApiClient.new(channel_access_token: 'test-channel-access-token') } |
183 | 226 | let(:response_body) { { "custom_aggregation_units" => ["unit1", "unit2"], "next" => "token" }.to_json } |
|
0 commit comments