Cucumber features/Rspec with third party oAuth API
I am using cucumber and RSpec for my new ruby on rails application and will be using some third party oAuth APIs to send/retrieve data. I am fairly new to both cucumber and RSpec and have never had to implement third party functionality like this before. What is the best way to handle this 开发者_如何学Gofrom a spec and feature writing perspective? I know I shouldn't be querying the services directly, because I can't spec for them being up or down, etc, so I'm sure I will need to stub/mock some objects/functions. Any help in this matter would be appreciated.
I use a gem called webmock and stub out the requests with results that I know are good. You can also automatically record requests with EphemeralResponse, but I haven't used that yet.
精彩评论