scube-server/spec/factories.rb
Thibault Jouan 27550fd14e 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.
2011-09-20 17:43:20 +00:00

32 lines
512 B
Ruby

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'
factory :track_with_sound do
file { build_sound_file }
end
end
factory :user do
sequence :email do |n|
"alice_#{n}@example.net"
end
password '733tP4s5'
end
end