I might be missing something trivial here... but how can I know that a POST was truly successful?
I'm writing some testing code with Test::Mojo and friends, and had this snippet
$t->ua->max_redirects(1); #post produces a redirect
$t->post_ok("/relationship" => json => {identifer => 'test:roughlyEquivalent',
description => "Close, but not quite"})
->status_is(200, "Add test:roughlyEquivalent");
$t->get_ok("/relationship/test:roughlyEquivalent")->status_is(200, "test:roughlyEquivalent now exists");
The status of the get_ok test failed, getting a 404. It took me a while to see that I'd mis-typed "identifier" in the post_ok line.
It feels wrong that I can have a key misspelled, causing the insert to fail, and still get a success message back.
Is there a deeper level of testing (or validation) available someplace?
Thanks,
-Randall