Implement playlists/create action for API
This commit is contained in:
22
spec/integration/api/playlists_spec.rb
Normal file
22
spec/integration/api/playlists_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'spec_helper'
|
||||
|
||||
feature 'API playlists' do
|
||||
include UserIntegrationHelpers
|
||||
|
||||
background do
|
||||
api_sign_in
|
||||
end
|
||||
|
||||
scenario 'creates playlist' do
|
||||
playlist = Factory.attributes_for :playlist
|
||||
|
||||
post api_playlists_path,
|
||||
:format => :json,
|
||||
:playlist => playlist
|
||||
|
||||
json = JSON response.body
|
||||
|
||||
json['id'].should be_a Fixnum
|
||||
json['name'].should == playlist[:name]
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user