File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 241
241
242
242
describe '#material_add' do
243
243
specify 'will post material/add_material with access_token, type and media payload at file based api endpoint' do
244
- file = 'file '
245
- expect ( subject . client ) . to receive ( :post )
246
- . with ( 'material/add_material' , { upload : { media : file } } ,
244
+ file = 'README.md '
245
+ expect ( subject . client ) . to receive ( :post_file )
246
+ . with ( 'material/add_material' , file ,
247
247
params : { type : 'image' , access_token : 'access_token' } ) . and_return ( true )
248
248
expect ( subject . material_add ( 'image' , file ) ) . to be true
249
249
end
Original file line number Diff line number Diff line change 37
37
specify 'will add accept=>:json for request' do
38
38
block = lambda do |url , headers |
39
39
expect ( url ) . to eq ( 'http://host/token' )
40
- expect ( headers ) . to eq ( params : { access_token : '1234' } , accept : : json)
40
+ expect ( headers ) . to eq ( params : { access_token : '1234' } , 'Accept' => 'application/ json' )
41
41
response_json
42
42
end
43
43
Original file line number Diff line number Diff line change 426
426
427
427
describe '#material_add' do
428
428
specify 'will post material/add_material with access_token, type and media payload at file based api endpoint' do
429
- file = 'file '
430
- expect ( subject . client ) . to receive ( :post )
431
- . with ( 'material/add_material' , { upload : { media : file } } ,
429
+ file = 'README.md '
430
+ expect ( subject . client ) . to receive ( :post_file )
431
+ . with ( 'material/add_material' , file ,
432
432
params : { type : 'image' , access_token : 'access_token' , agentid : '1' } ) . and_return ( true )
433
433
expect ( subject . material_add ( 'image' , file ) ) . to be true
434
434
end
You can’t perform that action at this time.
0 commit comments