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

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 })
主站蜘蛛池模板: 巴林右旗| 博罗县| 兴宁市| 陵水| 克什克腾旗| 昂仁县| 阜康市| 明溪县| 绵阳市| 西峡县| 南岸区| 日照市| 纳雍县| 泰安市| 尼勒克县| 桂阳县| 丰镇市| 江川县| 包头市| 万载县| 万宁市| 久治县| 宜章县| 岳西县| 蓬莱市| 北碚区| 泸溪县| 波密县| 神农架林区| 宜良县| 荔浦县| 句容市| 措勤县| 洛阳市| 府谷县| 伊宁县| 龙岩市| 张北县| 鹤峰县| 玉溪市| 临洮县|