dwyl / dwyl/github-backup

Test webhooks events

Offen
#26 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
help wanted technical
Vorherrschende Sprache
Elixir
Sterne
33
Forks
3
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

One way to test the logic of the app when a webhook request is received is to mock the request. The tests will send a "fake" payload on the endpoints of the app and from this can check that the logic of the controllers linked to the endpoint is correct. It is the way that we are currently using on dwylbot:

https://github.com/dwyl/dwylbot/blob/master/test/controllers/event_controller_test.exs

I'm wondering if we could find another way to test the application without using mock? I would prefer to use "real" data from Github and not based our test on fixtures which might not be updated for a long time (the Github API might change but not the fixtures)

see:
- http://blog.plataformatec.com.br/2015/10/mocks-and-explicit-contracts/
- https://stackoverflow.com/questions/16992777/is-there-a-sandbox-version-of-the-github-api-v3-for-testing-apps

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.