diff --git a/ruby/spec/jam_ruby/models/music_notation_spec.rb b/ruby/spec/jam_ruby/models/music_notation_spec.rb index c59ba7897..c1fb3e2e1 100644 --- a/ruby/spec/jam_ruby/models/music_notation_spec.rb +++ b/ruby/spec/jam_ruby/models/music_notation_spec.rb @@ -22,10 +22,11 @@ describe MusicNotation do notation = MusicNotation.new notation.file_url = File.open(NOTATION_TEMP_FILE) + notation.size = File.size(NOTATION_TEMP_FILE) notation.user = FactoryGirl.create(:user) notation.save! - File.basename(notation.file_url.path).should == NOTATION_TEMP_FILE + File.basename(notation.file_url.path).should == notation.user.id notation.size.should == File.size(NOTATION_TEMP_FILE) stub_const("APP_CONFIG", app_config) diff --git a/ruby/spec/jam_ruby/resque/unused_music_notation_cleaner_spec.rb b/ruby/spec/jam_ruby/resque/unused_music_notation_cleaner_spec.rb index 8657a508c..f47f186df 100644 --- a/ruby/spec/jam_ruby/resque/unused_music_notation_cleaner_spec.rb +++ b/ruby/spec/jam_ruby/resque/unused_music_notation_cleaner_spec.rb @@ -31,6 +31,7 @@ describe UnusedMusicNotationCleaner do it "find no music notataions if music_session_id is nil and created at 1 hour ago" do notation = MusicNotation.new notation.file_url = File.open(NOTATION_TEMP_FILE) + notation.size = 10 notation.user = FactoryGirl.create(:user) notation.created_at = Time.now - 1.hours notation.save! @@ -44,6 +45,7 @@ describe UnusedMusicNotationCleaner do notation = MusicNotation.new notation.file_url = File.open(NOTATION_TEMP_FILE) + notation.size = 10 notation.user = FactoryGirl.create(:user) notation.created_at = Time.now - 1.hours notation.music_session = music_session @@ -55,6 +57,7 @@ describe UnusedMusicNotationCleaner do it "find music notataions if music_session_id is nil and created at 2 days ago" do notation = MusicNotation.new notation.file_url = File.open(NOTATION_TEMP_FILE) + notation.size = 10 notation.user = FactoryGirl.create(:user) notation.created_at = Time.now - 2.days notation.save! @@ -68,6 +71,7 @@ describe UnusedMusicNotationCleaner do notation = MusicNotation.new notation.file_url = File.open(NOTATION_TEMP_FILE) + notation.size = 10 notation.user = FactoryGirl.create(:user) notation.created_at = Time.now - 3.days notation.music_session = music_session