Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save neokoenig/0eb9399a982d09464d925cc42902d00c to your computer and use it in GitHub Desktop.
Save neokoenig/0eb9399a982d09464d925cc42902d00c to your computer and use it in GitHub Desktop.
// asserts that a failed user update returns a 302 http response, an error exists in the flash and will be redirected to the error page
function testStatusFlashAndRedirect() {
local.params = {
controller = "users",
action = "update"
};
result = processRequest(params=local.params, method="post", rollback=true, returnAs="struct");
assert("result.status == 302");
assert("StructKeyExists(result.flash, 'error') == true");
assert("result.redirect == '/common/error'");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment