From d547e4c2d6a1eb652c1fa8ea1eb5f270f3403d6b Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 8 Sep 2014 22:23:35 -0400 Subject: [PATCH] VRFS-2094 fix tests --- ruby/spec/jam_ruby/models/music_notation_spec.rb | 3 ++- .../jam_ruby/resque/unused_music_notation_cleaner_spec.rb | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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