【问题标题】:Rspc: How to stub the MandrilApi dynamic template APIRspca:如何存根 Mandrill Api 动态模板 API
【发布时间】:2017-11-04 07:27:46
【问题描述】:

我已经尝试过了,但它不起作用我正在使用 GEM mandrill-api

https://bitbucket.org/mailchimp/mandrill-api-ruby/wiki/Home

config.before(:all) do 
  Excon.defaults[:mock] = true
  Excon.stub({}, {body: '{}', status: 200}) # stubs any request to return an empty JSON string
end

如何通过 mandrill-api gem 修复这些使用 Mandrill 模板的失败测试用例????

【问题讨论】:

    标签: ruby-on-rails-4 rspec rspec-rails mandrill


    【解决方案1】:

    您遇到了什么错误?对我来说,由于我的 Gemfile 中没有包含 Excon,我必须将 require 'excon' 添加到我的 spec_helper.rb 才能使存根工作。

    【讨论】:

      猜你喜欢
      • 2013-02-12
      • 2016-03-19
      • 2017-06-15
      • 2015-06-21
      • 2015-08-22
      • 2015-03-15
      • 1970-01-01
      • 1970-01-01
      • 2013-10-26
      相关资源
      最近更新 更多