Skip to content

Commit

Permalink
Return full song data in response of favorite playlist API
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Mar 11, 2024
1 parent 6cb81d9 commit 9ffc9b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
json.call(@song, :id, :name)
json.partial! "api/v1/songs/song", song: @song
Original file line number Diff line number Diff line change
@@ -1 +1 @@
json.call(@song, :id, :name)
json.partial! "api/v1/songs/song", song: @song
Original file line number Diff line number Diff line change
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 9ffc9b1

Please sign in to comment.