To run this project you need to have:
$ git clone <REPOSITORY_URL> mbank
- Clone the project$ cd mbank
- Go into the project folder$ bin/setup
- Run the setup script$ bin/rspec
- Run the specs to see if everything is working finecurl -H 'Content-Type: application/json' -d '{"user": {"email": "[email protected]", "password": "123456"}}' -X POST 'http://localhost:3000/users'
curl -v -H 'Content-Type: application/json' -d '{"user": {"email": "[email protected]", "password": "123456"}}' -X POST 'http://localhost:3000/users/sign_in'
For security reasons is required to create the admin user through rails console or database
curl -H 'Content-Type: application/json' -H 'Authorization: Bearer <TOKEN RECEIVED ON LOGIN HEADER>' -d '{"destination_account_id": 2, "amount": 100.00}' -X POST 'http://localhost:3000/deposits'
curl -H 'Content-Type: application/json' -H 'Authorization: <TOKEN RECEIVED ON LOGIN HEADER>' -X POST 'http://localhost:3000/accounts/'
curl -H 'Content-Type: application/json' -H 'Authorization: <TOKEN RECEIVED ON LOGIN HEADER>' -d '{"source_account_id": 1, "destination_account_id": 2, "amount": 100.00}' -X POST 'http://localhost:3000/transfers'
curl -H 'Content-Type: application/json' -H 'Authorization: <TOKEN RECEIVED ON LOGIN HEADER>' -X GET 'http://localhost:3000/accounts/:account_id/balance'