Change devise users path to /accounts instead of /users

master
Zequez 2015-08-07 05:52:04 -03:00
parent 5cb271cd73
commit bad861413f
4 changed files with 10 additions and 9 deletions

View File

@ -5,7 +5,7 @@
M<i class="fa fa-cog"></i><span>o</span>ds
.user-session
- if user_signed_in?
= link_to current_user.name, edit_user_registration_path(current_user)
= link_to current_user.name, edit_user_registration_path
|
= link_to t('.sign_out'), destroy_user_session_path
- else

View File

@ -14,6 +14,7 @@ Rails.application.routes.draw do
end
devise_for :users,
path: 'account',
path_names: { sign_in: 'login', sign_out: 'logout', sign_up: 'register' },
controllers: { registrations: 'users/registrations', sessions: 'users/sessions' }

View File

@ -1,6 +1,6 @@
feature 'Common sign in and sign up form everywhere' do
scenario '/users/login should have also a registration form', js: true do
visit '/users/login'
scenario 'login should have also a registration form', js: true do
visit new_user_session_path
expect(page).to have_field 'user_login'
expect(page).to_not have_field 'user_email'
expect(page).to_not have_field 'user_name'

View File

@ -6,7 +6,7 @@ feature 'Redirect to the previous page the user was after login' do
create :mod, name: 'Hey'
visit '/mods/hey'
click_link 'Login'
expect(current_path).to eq '/users/login'
expect(current_path).to eq new_user_session_path
within('#new_session') do
fill_in 'user_login', with: 'banana@split.com'
fill_in 'user_password', with: 'rsarsarsa'
@ -20,13 +20,13 @@ feature 'Redirect to the previous page the user was after login' do
create :mod, name: 'Hey'
visit '/mods/hey'
click_link 'Login'
expect(current_path).to eq '/users/login'
expect(current_path).to eq new_user_session_path
within('#new_session') do
fill_in 'user_login', with: 'banana@split.com'
fill_in 'user_password', with: 'nooooooooooooo'
click_button 'Login'
end
expect(current_path).to eq '/users/login'
expect(current_path).to eq new_user_session_path
within('#new_session') do
fill_in 'user_login', with: 'banana@split.com'
fill_in 'user_password', with: 'rsarsarsa'
@ -39,7 +39,7 @@ feature 'Redirect to the previous page the user was after login' do
create :mod, name: 'Hey'
visit '/mods/hey'
click_link 'Register'
expect(current_path).to eq '/users/register'
expect(current_path).to eq new_user_registration_path
within('#new_registration') do
fill_in 'user_email', with: 'banana@split.com'
fill_in 'user_name', with: 'Potato'
@ -53,14 +53,14 @@ feature 'Redirect to the previous page the user was after login' do
create :mod, name: 'Hey'
visit '/mods/hey'
click_link 'Register'
expect(current_path).to eq '/users/register'
expect(current_path).to eq new_user_registration_path
within('#new_registration') do
fill_in 'user_email', with: 'bansplit.com'
fill_in 'user_name', with: '----'
fill_in 'user_password', with: 'rsarsarsa'
click_button 'Register'
end
expect(current_path).to eq '/users'
expect(current_path).to eq user_registration_path
within('#new_registration') do
fill_in 'user_email', with: 'banana@split.com'
fill_in 'user_name', with: 'Potato'