green-fox-academy / hotel-booking-user-service

0 stars 0 forks source link

Register #28

Open vvarro opened 7 years ago

vvarro commented 7 years ago

Register

Create an endpoint that is able to add a new user to the database

Feature: Register

Scenario: Register Given the application running And 0 users in the database When the '/register' endpoint ir requested with a 'POST' request: """ { "data": { "type": "user", "attributes": { "email": "john.doe@example.org", "password": "suchsecret" } } } """ Then it should send a 201 response with a JSON: """ { "data": { "type": "user", "attributes": { "id": "1", "email": "john.doe@example.org", "admin": false, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEiLCJlbWFpbCI6ImpvaG4uZG9lQGV4YW1wbGUub3JnIiwiYWRtaW4iOmZhbHNlfQ.UK8Z1BNeHWvaFElWrrSxhO6oxTRaMW_66DO5yjkqOhM" } } } """