summaryrefslogtreecommitdiff
path: root/spec/features/users_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/users_spec.rb')
-rw-r--r--spec/features/users_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb
index b5a94fe0383..f2c0aa7784a 100644
--- a/spec/features/users_spec.rb
+++ b/spec/features/users_spec.rb
@@ -40,6 +40,23 @@ feature 'Users', feature: true do
expect(number_of_errors_on_page(page)).to be(1), 'errors on page:\n #{errors_on_page page}'
end
+ describe 'redirect alias routes' do
+ before { user }
+
+ scenario '/u/user1 redirects to user page' do
+ visit '/u/user1'
+
+ expect_user_show_page
+ end
+
+
+ scenario '/users/user1 redirects to user page' do
+ visit '/users/user1'
+
+ expect_user_show_page
+ end
+ end
+
def errors_on_page(page)
page.find('#error_explanation').find('ul').all('li').map{ |item| item.text }.join("\n")
end
@@ -47,4 +64,9 @@ feature 'Users', feature: true do
def number_of_errors_on_page(page)
page.find('#error_explanation').find('ul').all('li').count
end
+
+ def expect_user_show_page
+ expect(current_path).to eq user_path(user)
+ expect(page).to have_text(user.name)
+ end
end