Sha256: 6c21b7a97b9ecc4bcf246e355204dfd03a689e08f706bd68fb09912afaba688f
Contents?: true
Size: 1.09 KB
Versions: 11
Compression:
Stored size: 1.09 KB
Contents
require File.dirname(__FILE__) + '/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.length comment = @sc.Comment.create({:track_id => @track.id, :body => "new API Test comment"}) @track.comments.reload.length.should be old_count + 1 comment.destroy @track.comments.reload.length.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
11 entries across 11 versions & 1 rubygems