Implement playlist edit feature

* Display playlists as links in index
* Move playlist form in a partial
This commit is contained in:
Thibault Jouan
2011-07-12 11:34:40 +00:00
parent 33f979b573
commit 301205d3f0
10 changed files with 98 additions and 13 deletions

View File

@@ -3,20 +3,22 @@ require 'spec_helper'
describe 'playlists/index.html.haml' do
before do
assign :playlists, [
double('Playlist', :name => 'Foo'),
double('Playlist', :name => 'Bar')
mock_model('Playlist', :name => 'Electro')
]
end
it 'displays a list of playlists' do
render
rendered.should have_selector('ul>li', :count => 2)
rendered.should have_selector('ul>li', :text => 'Foo')
rendered.should have_selector('ul>li+li', :text => 'Bar')
rendered.should have_selector('ul>li', :text => 'Electro')
end
it 'displays a link to create a new playlist' do
render
rendered.should have_selector('a', :text => 'Create playlist')
end
it 'displays playlists as links' do
render
rendered.should have_selector('a', :text => 'Electro')
end
end