Save track files in new Sound model:

* Consolidate migrations
* Add Sound model. Each sound can belong to a track and contains
  informations about one sound file.
This commit is contained in:
Thibault Jouan
2011-09-15 21:08:24 +00:00
parent f49a5a3f67
commit 27550fd14e
26 changed files with 265 additions and 216 deletions

View File

@@ -28,17 +28,15 @@ feature 'Tracks' do
end
scenario 'plays track' do
track = Factory.create(:track, :name => 'Mega song')
file = File.new("#{Rails.root}/spec/fixtures/test.mp3")
track.save_with_file(file, 'audio/mpeg')
track = Factory.create(:track_with_sound)
visit track_path(track)
page.should have_xpath "//audio[@src='#{download_track_path(track)}']"
page.should have_xpath "//audio[@src='#{sound_path(track.sound)}']"
visit find('audio')[:src]
end
after do
`rm -f #{Rails.root}/data/tracks/*`
`rm -f #{Rails.root}/data/sounds/*`
end
end