https://github.com/monade/test_rails
https://github.com/monade/test_rails
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/monade/test_rails
- Owner: monade
- Created: 2019-06-07T13:30:43.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-15T12:33:48.000Z (about 2 years ago)
- Last Synced: 2025-04-25T13:04:14.229Z (about 1 year ago)
- Language: Ruby
- Size: 269 KB
- Stars: 1
- Watchers: 2
- Forks: 12
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
## Setup:
```bash
bundle install
yarn install
rails db:create db:migrate
rails db:seed
```
Per avviare il server:
```bash
rails server
bin/webpack-dev-server
```
Per avviare i test:
```bash
bundle exec rspec
```
### Compiti:
a) L'api corrente /api/posts ha un problema di performance molto comune. Qual è? Come si potrebbe risolvere?
b) Implementare una nuova API nel PostsController che, ricevendo in GET un parametro "term" permetta di cercare per nome e per tag i post.
Ad esempio, cercando "gatto", verrà trovato un post che contiene la parola gatto o che ha almeno un tag che si chiama "gatto".
Per l'implementazione, utilizzare l'approccio "TDD". Per farla semplice, implementa semplicemente un test nella cartella spec/requests similare a quello già fatto per l'index
c) Implementare in Vue un'input form, modificando il componente app.vue, che permetta di filtrare i post utilizzando l'API creata precedentemente.