PUT {{host}}/api/favorites
{
"selected": true,
"movie_id": "dune-1984"
}
HTTP 401
GET {{host}}/api/usernames/available
HTTP 200
username: jsonpath "$.username"
GET {{host}}/signup
HTTP 200
csrf_token: xpath "string(//input[@name='_csrf']/@value)"
POST {{host}}/signup
_csrf: {{csrf_token}}
username: {{username}}
name: Bob
email: {{username}}@example.net
password: 12345678
HTTP 302
header "Location" == "/my-movies"
GET {{host}}/my-movies
HTTP 200
xpath "//li[@class='favorite-movie']" count == 0
PUT {{host}}/api/favorites
{
"selected": true,
"movie_id": "dune-1984"
}
HTTP 200
jsonpath "$.selected" == true
PUT {{host}}/api/favorites
{
"selected": true,
"movie_id": "the-dark-crystal"
}
HTTP 200
jsonpath "$.selected" == true
GET {{host}}/my-movies
HTTP 200
xpath "//li[@class='favorite-movie']" count == 2
PUT {{host}}/api/favorites
{
"selected": false,
"movie_id": "the-dark-crystal"
}
HTTP 200
jsonpath "$.selected" == false
GET {{host}}/my-movies
HTTP 200
xpath "//li[@class='favorite-movie']" count == 1