Commit 10526031 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix users feature spec

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 6b90ccb9
...@@ -46,14 +46,8 @@ feature 'Users', feature: true do ...@@ -46,14 +46,8 @@ feature 'Users', feature: true do
scenario '/u/user1 redirects to user page' do scenario '/u/user1 redirects to user page' do
visit '/u/user1' visit '/u/user1'
expect_user_show_page expect(current_path).to eq user_path(user)
end expect(page).to have_text(user.name)
scenario '/users/user1 redirects to user page' do
visit '/users/user1'
expect_user_show_page
end end
end end
...@@ -64,9 +58,4 @@ feature 'Users', feature: true do ...@@ -64,9 +58,4 @@ feature 'Users', feature: true do
def number_of_errors_on_page(page) def number_of_errors_on_page(page)
page.find('#error_explanation').find('ul').all('li').count page.find('#error_explanation').find('ul').all('li').count
end end
def expect_user_show_page
expect(current_path).to eq user_path(user)
expect(page).to have_text(user.name)
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment