# Demonstrates conditional assertions based on variable values.
$ REST_ORIGIN = https://lorem-api.com/api
---
Echo a request
$ USERNAME = [foo, bar]
POST {{ REST_ORIGIN }}/echo
~~~ application/json
{
"username" : "{{ USERNAME }}",
"role" : "user"
}
~~~
# Echo request succeeds
^ & status == 200
# Echoes the fixed role
^ & body.role == "user"
# Echoes the username when USERNAME is foo
[ USERNAME == "foo" ] ^ & body.username == "foo"
# Echoes the username when USERNAME is bar
[ USERNAME == "bar" ] ^ & body.username == "bar"