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

@@ -1,16 +1,24 @@
def build_sound_file
file = File.new("#{Rails.root}/spec/fixtures/test.mp3")
file.stub(:content_type => 'audio/mpeg')
file
end
FactoryGirl.define do
factory :playlist do
name 'Electro'
user
end
factory :sound do
file { build_sound_file }
end
factory :track do
name 'Mega song'
mime_type 'audio/ogg'
sha256 '94a5486a69a7261da350c57f9e5a1eaa789e08752cfc56a1989976a6ad82f7a8'
after_create do |t|
t.save_with_file(File.new("#{Rails.root}/spec/fixtures/test.mp3"), 'audio/mpeg')
factory :track_with_sound do
file { build_sound_file }
end
end