* fix broken tests that occurred when removing mount_uploader from jam_track_track
This commit is contained in:
parent
bb35535262
commit
cfd80927f9
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue