Logo: Relish

  1. Sign in

Project: Trx2

Viewing a user

As a PasNL-terminal remote manager
I want to scan the barcode of a client card
In order to view and edit her account balance

Background Create a remote manager and a program
Given
a program with name "301"
And
I have an user "martijn" with password "dekker"
And
I send a POST request to "/api/v1/admin/login" :
  {
    "username":"martijn",
    "password":"dekker"
  }
Scenarios
Can retrieve user by barcode
Given
an enduser with barcode "123456789"
When
I send a GET request to "/api/v1/admin/users/123456789"
Then
"balance" in json is "1.0"
And
"email" in json is "[email protected]"
And
"gender" in json is "m"
And
I get a status "200" as response
Asking information about an unknown barcode gives an error
Given
an enduser with barcode "123456789"
When
I send a GET request to "/api/v1/admin/users/99999999"
Then
"message" in json is "barcode is geen onderdeel van dit programma"
Asking information with wrong token
Given
an enduser with barcode "999999999"
When
I send a GET request with wrong token to "/api/v1/admin/users/999999999"
Then
I get a status "401" as response

Last published almost 6 years ago by martijn dekker.