This challenge asks me to create CRUD routes with TDD.
Method | Path | Query | Body | Response |
---|---|---|---|---|
GET | /albums | - | - | albums_all.erb |
GET | /artists | - | - | artists_all.erb |
GET | /albums/:id | - | - | albums_one.erb |
GET | /artists/:id | - | - | artists_one.erb |
POST | /albums | - | title, release_year, artist_id | - |
POST | /artists | - | name, genre | - |
# Request:
Method: GET /albums
# Expected response:
Body: "Doolittle, Surfer Rosa, ...Ring Ring"
Status: Response for 200 OK
# Request:
GET /artists
# Expected response
Body: Pixies, ABBA, Taylor Swift, Nina Simone
Status: Response for 200 OK
# Request:
Method: POST /albums
Body: { title: "Voyage", release_year: 2022, artist_id: 2 }
# Expected response:
Status: Response for 200 OK
# Request:
POST /artists
# With body parameters:
name=Wild nothing
genre=Indie
# Expected response (200 OK)
(No content)
# Then subsequent request:
GET /artists
# Expected response (200 OK)
Pixies, ABBA, Taylor Swift, Nina Simone, Wild nothing