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,9 +1,7 @@
require 'spec_helper'
describe 'tracks/show.html.haml' do
let(:track) do
mock_model('Track', :name => 'Mega song')
end
let(:track) { Factory.create(:track) }
before do
assign :track, track
@@ -14,7 +12,9 @@ describe 'tracks/show.html.haml' do
rendered.should have_selector('h1', :text => 'Mega song')
end
context 'audio tag' do
context 'when track has a sound' do
let(:track) { Factory.create(:track_with_sound) }
it 'provides an audio stream for the track' do
render
rendered.should have_selector('audio[src]')