Auto testing of webhook requests in Ruby on Rails

h1624938's Avatar

h1624938

09 Nov, 2012 01:56 AM

Hi, sorry if I should be asking this on Rails forums instead, but just wondering if someone already has prior experience with writing test cases to test CG web hooks.

I'm having trouble writing automated tests for actions initiated by the CG web hook. I have thought of about recording down the requests and then post them locally from a serialized file. Does anyone know any other methods of dealing with testing web hooks?

  1. Support Staff 1 Posted by Marc Guyer on 09 Nov, 2012 09:01 PM

    Marc Guyer's Avatar

    Hi -- This really isn't a rails related question I think. The answer depends on your development environment. The key to webhooks is that they are like an API but they work in the other direction. In other words, the hook sender (CheddarGetter) must be able to access your development environment over the public internet. So, your dev environment needs to be accessible. If your dev environment runs on a local machine inside a private network, you've got issues.

    You might check out PostCatcher for basic post testing. Also, maybe look at Localtunnel if you want to expose a port from your local machine on the public web.

  2. 2 Posted by h1624938 on 12 Nov, 2012 03:34 AM

    h1624938's Avatar

    Yes you're right, I've done exactly that - I have recorded the posts and now I'm manually simulating it in my own environment, eliminating the need to wait for an actual webhook call from CG. This seems to work well so far, thanks.

  3. Support Staff 3 Posted by Marc Guyer on 12 Nov, 2012 01:29 PM

    Marc Guyer's Avatar

    Very cool - mocking the process is certainly an effective way to automate tests efficiently.

  4. Marc Guyer closed this discussion on 12 Nov, 2012 01:29 PM.

Discussions are closed to public comments.
If you need help with Cheddar please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM