Skip to content

Commit

Permalink
Merge e513215 into 0627416
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Mar 18, 2024
2 parents 0627416 + e513215 commit d8cabfa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
@@ -0,0 +1 @@
json.partial! "api/v1/songs/song", song: @song
12 changes: 10 additions & 2 deletions test/controllers/api/v1/current_playlist/songs_controller_test.rb
Expand Up @@ -17,10 +17,18 @@ class Api::V1::CurrentPlaylist::SongsControllerTest < ActionDispatch::Integratio
end

test "should remove songs from playlist" do
delete api_v1_current_playlist_song_url(id: 1), headers: api_token_header(@user)
delete api_v1_current_playlist_song_url(id: 1), as: :json, headers: api_token_header(@user)
response = @response.parsed_body

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

delete api_v1_current_playlist_song_url(id: 3), headers: api_token_header(@user)
delete api_v1_current_playlist_song_url(id: 3), as: :json, headers: api_token_header(@user)
response = @response.parsed_body

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

Expand Down
Expand Up @@ -31,6 +31,7 @@ class Api::V1::FavoritePlaylist::SongsControllerTest < ActionDispatch::Integrati

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

Expand Down

0 comments on commit d8cabfa

Please sign in to comment.