scube-server/spec/views/playlists/edit.html.haml_spec.rb
2015-04-30 12:31:02 +00:00

22 lines
686 B
Ruby

describe 'playlists/edit' do
let(:playlist) { mock_model(Playlist).as_new_record.as_null_object }
before { assign :playlist, playlist }
it 'renders a form to edit a playlist' do
render
expect(rendered)
.to have_selector("form[method=post][action='#{playlists_path}']")
expect(rendered).to have_selector('input[type=submit]')
end
it 'renders a text field with a label for the playlists name' do
allow(playlist).to receive(:name) { 'Electro' }
render
expect(rendered)
.to have_selector "input[type=text][name='playlist[name]'][value=Electro]"
expect(rendered)
.to have_selector 'label[for=playlist_name]', text: 'Name'
end
end