Implement API playlists/update

This commit is contained in:
Thibault Jouan
2015-05-03 23:20:43 +00:00
parent 317c2b687f
commit d03007c99f
3 changed files with 19 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ describe 'API playlists' do
)
end
it 'creates playlist' do
it 'creates a playlist' do
playlist = attributes_for :playlist
post api_playlists_path, format: :json, playlist: playlist
expect(json).to match(
@@ -33,4 +33,15 @@ describe 'API playlists' do
}
)
end
it 'updates a playlist' do
playlist = create :playlist
put api_playlist_path(playlist), format: :json, playlist: {
name: 'new name'
}
get api_playlist_path playlist, format: :json
expect(json[:playlist]).to include(
name: 'new name'
)
end
end