|
178 | 178 | .with(body: File.open(RICH_MENU_IMAGE_FILE_PATH).read)
|
179 | 179 | end
|
180 | 180 |
|
181 |
| - it 'uploads and attaches am image to a rich menu from uri' do |
| 181 | + it 'uploads and attaches an image to a rich menu from uri' do |
182 | 182 | uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_BLOB_ENDPOINT + '/bot/richmenu/1234567/content'
|
183 | 183 |
|
184 | 184 | stub_request(:post, uri_template).to_return(body: '{}', status: 200).with do |request|
|
|
188 | 188 | image_url = 'https://line.example.org/rich_menu.png'
|
189 | 189 | image_content = File.open(RICH_MENU_IMAGE_FILE_PATH).read
|
190 | 190 | image_content.force_encoding('ASCII-8BIT')
|
191 |
| - stub_request(:get, image_url).to_return(body: image_content, status: 200, headers: { 'Content-type' => 'image/png' }) |
| 191 | + stub_request(:get, image_url).to_return(body: image_content, status: 200, headers: { 'Content-Type' => 'image/png' }) |
192 | 192 |
|
193 | 193 | client.create_rich_menu_image('1234567', URI.parse(image_url).open)
|
194 | 194 |
|
|
206 | 206 | end.to raise_error(ArgumentError)
|
207 | 207 | end
|
208 | 208 |
|
209 |
| - it "uploads invalid content type uri" do |
| 209 | + it 'uploads invalid content type uri' do |
210 | 210 | uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_ENDPOINT + '/bot/richmenu/1234567/content'
|
211 | 211 | stub_request(:post, uri_template).to_return(body: '{}', status: 200)
|
212 | 212 |
|
213 | 213 | text_url = 'https://line.example.org/rich_menu.txt'
|
214 | 214 | text_content = File.open(RICH_MENU_INVALID_FILE_EXTENSION_PATH).read
|
215 |
| - stub_request(:get, text_url).to_return(body: text_content, status: 200, headers: { 'Content-type' => 'plain/text' }) |
| 215 | + stub_request(:get, text_url).to_return(body: text_content, status: 200, headers: { 'Content-Type' => 'plain/text' }) |
216 | 216 |
|
217 | 217 | expect do
|
218 | 218 | client.create_rich_menu_image('1234567', URI.parse(text_url).open)
|
|
0 commit comments