jjzjj

ruby-on-rails - 在使用 WebMock 时遇到问题,没有正确 stub

Ruby1.9.3、RSpec2.13.0、WebMock1.17.4、Rails3我正在为公司应用程序编写测试。有问题的Controller显示客户调用的电话表,并允许排序/过滤选项。编辑测试失败,因为在我当前的设置中,路径没有呈现,因为recorder_server没有在本地运行,或者没有正确设置。也请帮忙解决这个问题。AErrno::ECONNREFUSEDoccurredinrecordings#index:Connectionrefused-connect(2)/usr/local/lib/ruby/1.9.1/net/http.rb:763:in`initialize'--

ruby - 使用 webmock/rspec stub 多部分请求

我一直在尝试使用webmock对多部分请求进行stub,但没有找到令人满意的解决方案。理想情况下,我想将请求stub如下:stub_request(:post,'http://test.api.com').with(:body=>{:file1=>File.new('filepath1'),file2=>File.new('filepath2')})然而,这似乎不起作用,RSpec提示请求没有被stub。打印非stub请求:stub_request(:post,"http://test.api.com").with(:body=>"--785340\r\nContent-Disposi
12