In this project I used:
- Rspec for tests
- Rubocop for static code analysis
- Factory Bot for test data
- Shoulda Matchers to simplify model specs
- Versionist for versioning Rails based RESTful APIs.
- Ruby 2.5.1
- Rails 5.2.1
Clone the repository
git clone https://github.com/emmanuelperotto/api-test
Run this commands to create, seed database and run api locally
cd api-test
bundle install
rails db:create db:migrate db:seed
rails s
- returns a list of all events in the database
- Body JSON format (required)
{
"event": {
"name": "Teste",
"description": "Teste",
"lat": -15.783475,
"lng": -47.899205
}
}
- returns a list of all comments in the database
- returns a list of all reported comments in database
- Body JSON format (required)
{
"comment": {
"text": "Teste",
"user_id": 1,
"event_id": 1
}
}
bundle exec rspec