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

0 stars 0 forks source link

Login #33

Open vvarro opened 7 years ago

vvarro commented 7 years ago

Login

Create a simple endpoint for logging the user in

Feature: Register

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