Update specs to new rspec syntax
This commit is contained in:
@@ -12,7 +12,7 @@ feature 'Home page' do
|
||||
|
||||
visit root_path
|
||||
|
||||
page.should have_content('Electro')
|
||||
expect(page).to have_content 'Electro'
|
||||
end
|
||||
|
||||
scenario 'displays last track added' do
|
||||
@@ -27,6 +27,6 @@ feature 'Home page' do
|
||||
|
||||
visit root_path
|
||||
|
||||
page.body.should match(/Mega song 2.+Mega song 1/m)
|
||||
expect(page.body).to match /Mega song 2.+Mega song 1/m
|
||||
end
|
||||
end
|
||||
|
@@ -13,7 +13,7 @@ feature 'Playlists' do
|
||||
|
||||
visit playlists_path
|
||||
|
||||
page.body.should match(/Electro.+Reggae/m)
|
||||
expect(page.body).to match /Electro.+Reggae/m
|
||||
end
|
||||
|
||||
scenario 'creates playlist' do
|
||||
@@ -23,8 +23,8 @@ feature 'Playlists' do
|
||||
fill_in 'Name', with: 'Electro'
|
||||
click_button 'Create'
|
||||
|
||||
current_path.should == playlists_path
|
||||
page.should have_content('Electro')
|
||||
expect(current_path).to eq playlists_path
|
||||
expect(page).to have_content 'Electro'
|
||||
end
|
||||
|
||||
scenario 'edits playlist' do
|
||||
@@ -35,7 +35,7 @@ feature 'Playlists' do
|
||||
fill_in 'Name', with: 'Rock'
|
||||
click_button 'Save'
|
||||
|
||||
current_path.should == playlists_path
|
||||
page.should have_content('Rock')
|
||||
expect(current_path).to eq playlists_path
|
||||
expect(page).to have_content 'Rock'
|
||||
end
|
||||
end
|
||||
|
@@ -12,7 +12,7 @@ feature 'Tracks' do
|
||||
|
||||
visit track_path(track)
|
||||
|
||||
page.should have_content('Mega song')
|
||||
expect(page).to have_content 'Mega song'
|
||||
end
|
||||
|
||||
scenario 'creates track' do
|
||||
@@ -23,8 +23,8 @@ feature 'Tracks' do
|
||||
attach_file 'File', File.expand_path('spec/fixtures/test.mp3')
|
||||
click_button 'Upload'
|
||||
|
||||
current_path.should == track_path(Track.first)
|
||||
page.should have_content('Mega song')
|
||||
expect(current_path).to eq track_path Track.first
|
||||
expect(page).to have_content 'Mega song'
|
||||
end
|
||||
|
||||
scenario 'plays track' do
|
||||
@@ -32,7 +32,7 @@ feature 'Tracks' do
|
||||
|
||||
visit track_path(track)
|
||||
|
||||
page.should have_xpath "//audio[@src='#{sound_path(track.sound)}']"
|
||||
expect(page).to have_xpath "//audio[@src='#{sound_path track.sound}']"
|
||||
visit find('audio')[:src]
|
||||
end
|
||||
end
|
||||
|
@@ -4,7 +4,7 @@ feature 'User sign in' do
|
||||
scenario 'redirects to the home page when not signed in' do
|
||||
visit root_path
|
||||
|
||||
current_path.should == new_session_path
|
||||
expect(current_path).to eq new_session_path
|
||||
end
|
||||
|
||||
scenario 'signs the user in' do
|
||||
@@ -15,6 +15,6 @@ feature 'User sign in' do
|
||||
fill_in 'Password', with: user.password
|
||||
click_button 'Sign in'
|
||||
|
||||
current_path.should == root_path
|
||||
expect(current_path).to eq root_path
|
||||
end
|
||||
end
|
||||
|
@@ -19,6 +19,6 @@ feature 'User sign up' do
|
||||
scenario 'redirects to the home page' do
|
||||
click_button 'Sign up'
|
||||
|
||||
current_path.should == root_path
|
||||
expect(current_path).to eq root_path
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user