This is a basic Rails Api app, that implements CRUD (Create, Read, Update, Destroy) methods for the dogs endpoint.
- To flatten the response active-model-serializer is used,
- rspec & FactoryBotaare used for testing.
To run this app locally Ruby and SQLite3 should be installed. Installation instructions can be found here.
Then, after cloning the project and moving to the project folder, the following commands should bring you up to speed:
bundle install rails db:create rails db:migrate rails db:seed rails s
By default Rails app runs on "http://127.0.0.1:3000". You should be able to make the following requests
GET localhost:3000/api/v1/dogs
POST localhost:3000/api/v1/dogs/
with params
{ "name": "bestie", "company": #{company.id}, "breed": #{breed.id} }
GET localhost:3000/api/v1/dogs/#{dog.id}
PUT localhost:3000/api/v1/dogs/#{dog.id}
with params (only name can be changed)
{ "name": "bestie", }
DELETE localhost:3000/api/v1/dogs/#{dog.id}
To run test suits please use the following command:
Then, after cloning the project and moving to the project folder, the following commands should bring you up to speed:
rspec