Implement tracks/{show,listen}

This commit is contained in:
Thibault Jouan
2011-07-13 18:34:41 +00:00
parent 3e7f4a7168
commit 34b38b77cf
12 changed files with 142 additions and 26 deletions

View File

@@ -0,0 +1,30 @@
require 'spec_helper'
describe 'tracks/show.html.haml' do
let(:track) do
mock_model('Track', :name => 'Mega song')
end
before do
assign :track, track
end
it 'displays the name of the track' do
render
rendered.should have_selector('h1', :text => 'Mega song')
end
context 'audio tag' do
it 'provides an audio stream for the track' do
render
rendered.should have_selector('audio[src]')
end
it 'displays a text fallback for UA without support' do
render
rendered.should have_selector('audio',
:text => 'Your browser does not support the audio element'
)
end
end
end