* fix broken tests that occurred when removing mount_uploader from jam_track_track

This commit is contained in:
Seth Call 2015-03-17 13:39:21 -05:00
parent bb35535262
commit cfd80927f9
2 changed files with 9 additions and 8 deletions

View File

@ -58,15 +58,15 @@ describe JamTrackRight do
user = FactoryGirl.create(:user)
jam_track_track = FactoryGirl.create(:jam_track_track)
jam_track = jam_track_track.jam_track
uploader = JamTrackTrackUploader.new(jam_track_track, :url_48)
uploader.store!(File.open(ogg_path, 'rb'))
s3 = S3Manager.new(APP_CONFIG.aws_bucket, APP_CONFIG.aws_access_key_id, APP_CONFIG.aws_secret_access_key)
s3.upload(jam_track_track.manually_uploaded_filename(:url_48), ogg_path)
jam_track_track[:url_48] = jam_track_track.manually_uploaded_filename(:url_48)
jam_track_track.save!
jam_track_track[:url_48].should == jam_track_track.manually_uploaded_filename(:url_48)
# verify it's on S3
s3 = S3Manager.new(APP_CONFIG.aws_bucket, APP_CONFIG.aws_access_key_id, APP_CONFIG.aws_secret_access_key)
s3.exists?(jam_track_track[:url_48]).should be_true
s3.length(jam_track_track[:url_48]).should == File.size?(ogg_path)

View File

@ -46,9 +46,11 @@ describe JamTrackTrack do
end
it "uploads to s3 with correct name, and then downloads via signed URL" do
s3 = S3Manager.new(APP_CONFIG.aws_bucket, APP_CONFIG.aws_access_key_id, APP_CONFIG.aws_secret_access_key)
jam_track_track = FactoryGirl.create(:jam_track_track)
uploader = JamTrackTrackUploader.new(jam_track_track, :url_48)
uploader.store!(File.open(TRACK_NAME)) # uploads file
s3.upload(jam_track_track.manually_uploaded_filename(:url_48), TRACK_NAME)
jam_track_track[:url_48] = jam_track_track.manually_uploaded_filename(:url_48)
jam_track_track.save!
jam_track_track.reload
@ -56,7 +58,6 @@ describe JamTrackTrack do
jam_track_track[:url_48].should == jam_track_track.manually_uploaded_filename(:url_48)
# verify it's on S3
s3 = S3Manager.new(APP_CONFIG.aws_bucket, APP_CONFIG.aws_access_key_id, APP_CONFIG.aws_secret_access_key)
s3.exists?(jam_track_track[:url_48]).should be_true
s3.length(jam_track_track[:url_48]).should == 'abc'.length