Skip to content
Snippets Groups Projects
Commit 04086b36 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

pattern matching

parent 879277e1
No related branches found
No related tags found
1 merge request!2Stripe webhook
...@@ -79,4 +79,5 @@ spec_webhook = with (return app) $ do ...@@ -79,4 +79,5 @@ spec_webhook = with (return app) $ do
postJSON "/webhook" event `shouldRespondWith` 200 { matchBody = MatchBody bodyMatcher } postJSON "/webhook" event `shouldRespondWith` 200 { matchBody = MatchBody bodyMatcher }
bodyMatcher :: [Network.HTTP.Types.Header] -> Body -> Maybe String bodyMatcher :: [Network.HTTP.Types.Header] -> Body -> Maybe String
bodyMatcher _ body = if body == "{}" then Nothing else Just $ show body bodyMatcher _ "{}" = Nothing
bodyMatcher _ body = Just $ show body
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment