Update specs to new rspec syntax

This commit is contained in:
Thibault Jouan
2014-04-01 18:15:44 +00:00
parent 99d106cf36
commit 4cef7aeab9
32 changed files with 173 additions and 179 deletions

View File

@@ -11,16 +11,16 @@ describe 'playlists/edit' do
it 'renders a form to edit a playlist' do
render
rendered.should have_selector("form[method=post][action='#{playlists_path}']")
rendered.should have_selector('input[type=submit]')
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
playlist.stub(name: 'Electro')
allow(playlist).to receive(:name) { 'Electro' }
render
rendered.should have_selector(
"input[type=text][name='playlist[name]'][value=Electro]"
)
rendered.should have_selector("label[for=playlist_name]", text: 'Name')
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