Sha256: 4e1eaa1dc985533ac3774e592629261116f13f629c0061ae8f3f89c0d7a19593

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'

describe 'Soundcloud::Models::Comment' do
   before(:all) do
    @sc = Soundcloud.register({:access_token=> valid_oauth_access_token, :site => soundcloud_site})
#    @api_test_1 = @sc.User.find('api-test-1')    
#    @api_test_2 = @sc.User.find('api-test-2')    
#    @api_test_3 = @sc.User.find('api-test-3')  
    @track = @sc.Track.find('static-test-track')
  end
  
  it 'should be able to create and delete a new comment for a track' do

    old_count = @track.comments.count  
    comment = @sc.Comment.create({:track_id => @track.id, :body => "new API Test comment"})
    @track.comments.reload.count.should be old_count + 1
    
    comment.destroy
    
    @track.comments.reload.count.should be old_count
  end
  
  it 'should belong to a track and a user' do
    comment =  @track.comments.first
    
    comment.user.id.should_not be nil
    comment.track.id.should_not be nil
  end
  
  it 'should create a new comment and associate the track_id' do
    comment = @sc.Comment.new({:track => @track})
    comment.track_id.should be @track.id
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
soundcloud-ruby-api-wrapper-0.1.5 spec/soundcloud_comment_spec.rb
soundcloud-ruby-api-wrapper-0.1.6 spec/soundcloud_comment_spec.rb
soundcloud-ruby-api-wrapper-0.1.8 spec/soundcloud_comment_spec.rb
soundcloud-ruby-api-wrapper-0.1.9 spec/soundcloud_comment_spec.rb