官术网_书友最值得收藏!

How to do it...

Now that you have webmock included in your project, you can start stubbing HTTP requests in your specs. Once again, open specs/spec_helper.rb and add the following content:

stub_request(:post, "attachment-service.yourorg.example.com").
  with(body: {media_type: 1}, headers: {"Content-Type" => /image\/.+/}).
  to_return(body: { foo: bar })
主站蜘蛛池模板: 荔波县| 龙南县| 从化市| 磐安县| 西青区| 铜陵市| 拜泉县| 诏安县| 永济市| 博客| 达州市| 石渠县| 崇左市| 遂平县| 新化县| 上栗县| 赣榆县| 西华县| 辽源市| 上饶市| 永登县| 江西省| 江孜县| 潍坊市| 托克逊县| 临高县| 历史| 宁明县| 仁布县| 盖州市| 达州市| 海兴县| 资源县| 朔州市| 城步| 乌拉特前旗| 牟定县| 油尖旺区| 利津县| 信宜市| 新密市|