VRFS-2094 fix tests

This commit is contained in:
Brian Smith 2014-09-08 22:23:35 -04:00
parent 850709e51a
commit d547e4c2d6
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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