remove redirect hack for devise

only expose routes from devise that we actually use
This commit is contained in:
Benjamin Neff 2016-08-10 01:34:05 +02:00
parent 86e75a02bb
commit be47c6bcd0
7 changed files with 12 additions and 13 deletions

View file

@ -30,6 +30,6 @@
= t("layouts.header.profile")
= person_image_tag(current_user, size: :thumb_small)
%li= link_to t("_contacts"), contacts_path
%li= link_to t("layouts.header.settings"), users_edit_path
%li= link_to t("layouts.header.settings"), edit_user_path
%li= link_to t("layouts.application.toggle"), toggle_mobile_path
%li= link_to t("layouts.header.logout"), destroy_user_session_path, method: :delete

View file

@ -115,12 +115,11 @@ Diaspora::Application.routes.draw do
get "getting_started_completed" => :getting_started_completed
end
# This is a hack to overide a route created by devise.
# I couldn't find anything in devise to skip that route, see Bug #961
get 'users/edit' => redirect('/user/edit')
devise_for :users, :controllers => {:registrations => "registrations",
:sessions => "sessions"}
devise_for :users, controllers: {sessions: :sessions}, skip: :registration
devise_scope :user do
get "/users/sign_up" => "registrations#new", :as => :new_user_registration
post "/users" => "registrations#create", :as => :user_registration
end
#legacy routes to support old invite routes
get 'users/invitation/accept' => 'invitations#edit'

View file

@ -3,7 +3,7 @@ Feature: Change email
Scenario: Change my email
Given I am signed in
When I go to the users edit page
When I go to the edit user page
And I fill in the following:
| user_email | new_email@newplac.es |
And I press "Change email"
@ -14,7 +14,7 @@ Feature: Change email
Scenario: Change my email preferences
Given I am signed in
When I go to the users edit page
When I go to the edit user page
And I uncheck "user_email_preferences_mentioned"
And I press "change_email_preferences"
Then I should see "Email notifications changed"

View file

@ -3,7 +3,7 @@ Feature: Change password
Scenario: Change my password
Given I am signed in
When I go to the users edit page
When I go to the edit user page
And I fill out change password section with my password and "newsecret" and "newsecret"
And I press "Change password"
Then I should see "Password changed"

View file

@ -6,7 +6,7 @@ Feature: Close account
Scenario: user closes account
Given I am signed in
When I go to the users edit page
When I go to the edit user page
And I click on selector "#close_account"
Then I should see a modal
And I should see "Hey, please dont go!" within "#closeAccountModal"

View file

@ -6,7 +6,7 @@ Feature: Change password
Scenario: Change my password
Given I am signed in on the mobile website
When I go to the users edit page
When I go to the edit user page
And I fill out change password section with my password and "newsecret" and "newsecret"
And I press "Change password"
Then I should see "Password changed"

View file

@ -6,7 +6,7 @@ Feature: Close account
Scenario: user closes account
Given I am signed in on the mobile website
When I go to the users edit page
When I go to the edit user page
And I click on selector "#close_account"
Then I should see a modal
And I should see "Hey, please dont go!" within "#closeAccountModal"