tristandunn / pusher-fake

A fake Pusher server for development and testing.
https://rubygems.org/gems/pusher-fake
MIT License
173 stars 32 forks source link

Simulating Pusher errors? #51

Closed ronaldsalas closed 7 years ago

ronaldsalas commented 7 years ago

Is there a way to simulate 403 errors, for example, as a response from Pusher? I've been pouring over the repo and I can't find a way yet.

tristandunn commented 7 years ago

@ronaldsalas Where / when are you trying to simulate the 403 error?

ronaldsalas commented 7 years ago

For now on the server side when publishing an event. At least that's our primary scenario we want to test our app against at the moment.

I imagine though that we would want to increase our "reliability" test coverage down the road but I haven't thought of it yet.

tristandunn commented 7 years ago

So, when you use the Pusher Ruby client to publish an event to a user you want to receive a 403 response from the fake server? If that's the case, it seems that something like FakeWeb might be more appropriate, so you can stub out the real or fake URL to return an error.

ronaldsalas commented 7 years ago

Awesome! Thanks @tristandunn for directing me to FakeWeb. I'll have a look at it.