-
-
Save omega/d25085cde48261f37e9b to your computer and use it in GitHub Desktop.
Sample test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $json = $t->json_get_ok('/host/?routes=1') # A method that checks content_type for you. | |
->json_query('0.routes.0.target_id', 1) # Query for scalar values will compare them | |
->json_query('0.routes', 8) # If the value after the query is an array-ref, we will check length. | |
->json_query('0.routes.0', { # If the value after the query is an hash ref, and the expects is a | |
target_id => 1, # hashref, we is_deeply on the two. | |
reversed => 0, | |
host_id => 1, | |
id => 1, | |
path => '@chat', | |
target_type => 'handler', | |
}) | |
->json_content; # Pure helper method to get the json-content for more extensive tests | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment