【发布时间】:2014-01-26 04:33:47
【问题描述】:
我在我的系统中使用 activemerchant gem 实现了一个 PayPal API,我想编写一些规范来测试它,我已经搜索了很多示例但我没有找到任何示例,我想完全测试创建操作一条虚假的 PayPal 消息,我试过这个:
ActiveMerchant::Billing::Integrations::Paypal::Notification.any_instance.stub('acknowledge').and_return(true)
但随后测试进入了无限循环并返回了这个错误:
Api::PaypalIpnController GET create update the order from pending to complete
Failure/Error: Unable to find matching line from backtrace
SystemStackError:
stack level too deep
我在互联网上搜索了很多次,但没有找到有关如何模拟 PayPal 消息的示例或参考,我们将不胜感激。 谢谢。
【问题讨论】:
标签: ruby-on-rails rspec paypal-ipn activemerchant