To run this project you need to have:
- Ruby 2.6.3
- PostgreSQL
- Install the dependencies above
$ 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 fine
- bundle exec rails s
- bundle exec rspec
curl -H 'Content-Type: application/json' -d '{"user": {"email": "johndoe@mbank.com", "password": "123456"}}' -X POST 'http://localhost:3000/users'
curl -v -H 'Content-Type: application/json' -d '{"user": {"email": "johndoe@mbank.com", "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'
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request