Skip to content

Commit

Permalink
Merge pull request #360 from blackcandy-org/favorite-api-response
Browse files Browse the repository at this point in the history
Return full song data in response of favorite playlist API
  • Loading branch information
aidewoode committed Mar 11, 2024
2 parents 6cb81d9 + 9ffc9b1 commit 0627416
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
@@ -1 +1 @@
json.call(@song, :id, :name)
json.partial! "api/v1/songs/song", song: @song
@@ -1 +1 @@
json.call(@song, :id, :name)
json.partial! "api/v1/songs/song", song: @song
Expand Up @@ -13,6 +13,7 @@ class Api::V1::FavoritePlaylist::SongsControllerTest < ActionDispatch::Integrati

assert_response :success
assert_equal 3, response["id"]
assert response["is_favorited"]
assert_equal [3, 1, 2], @playlist.reload.song_ids
end

Expand All @@ -22,6 +23,7 @@ class Api::V1::FavoritePlaylist::SongsControllerTest < ActionDispatch::Integrati

assert_response :success
assert_equal 1, response["id"]
assert_not response["is_favorited"]
assert_equal [2], @playlist.reload.song_ids

delete api_v1_favorite_playlist_song_url(id: 2), as: :json, headers: api_token_header(@user)
Expand Down

0 comments on commit 0627416

Please sign in to comment.