A simple project using Rails to implement some tests. In this project is possible see tests in models, controllers (requests) and serializers.
The project ERM (Entity Relational Model) is as shown in the image below.
1 - Ruby
To install Ruby, I recommended use rbenv (Just follow the instructions in link)
2 - Postgres
To install Postgres, I recommended use Docker (This link is the official image of the Postgres)
1 - Install all dependencies of the project
bundle install2 - Initialize and run migrates in database
rails db:create & rails db:migrateObs: Don't forget to go up your database before run the command above
All the tests uses the FactoryBot to control the base of the tests and FFaker to generate some datas
To run all tests in project, simple run:
rspec