From e39cc464b166575e97a47154ce2d1296308a94a2 Mon Sep 17 00:00:00 2001
From: Stephan Kaag
- <%= raw t('change_email.please_continue', link: link_to(SiteSetting.title, root_path)) %> + <%= raw t('change_email.please_continue', link: link_to(SiteSetting.title, '/')) %>
<%end%> diff --git a/app/views/users/password_reset.html.erb b/app/views/users/password_reset.html.erb index b7b95a9e1..b5b73e277 100644 --- a/app/views/users/password_reset.html.erb +++ b/app/views/users/password_reset.html.erb @@ -18,7 +18,7 @@ <%- if @requires_approval %> <%= t 'login.not_approved' %> <% else %> - <%= link_to( t('password_reset.continue', site_name: SiteSetting.title), root_path ) %> + <%= link_to( t('password_reset.continue', site_name: SiteSetting.title), '/' ) %> <% end %> <% else %> diff --git a/config/routes.rb b/config/routes.rb index 1057ceff8..81a8afaba 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,7 +10,7 @@ USERNAME_ROUTE_FORMAT = /[A-Za-z0-9\_]+/ unless defined? USERNAME_ROUTE_FORMAT Discourse::Application.routes.draw do - match "/404", to: "exceptions#not_found" + match "/404", to: "exceptions#not_found", via: [:get, :post] mount Sidekiq::Web => '/sidekiq', constraints: AdminConstraint.new @@ -84,7 +84,7 @@ Discourse::Application.routes.draw do end end - get 'email_preferences' => 'email#preferences_redirect' + get 'email_preferences' => 'email#preferences_redirect', :as => 'email_preferences_redirect' get 'email/unsubscribe/:key' => 'email#unsubscribe', as: 'email_unsubscribe' post 'email/resubscribe/:key' => 'email#resubscribe', as: 'email_resubscribe' @@ -148,8 +148,8 @@ Discourse::Application.routes.draw do resources :notifications resources :categories - match "/auth/:provider/callback", to: "users/omniauth_callbacks#complete" - match "/auth/failure", to: "users/omniauth_callbacks#failure" + match "/auth/:provider/callback", to: "users/omniauth_callbacks#complete", via: [:get, :post] + match "/auth/failure", to: "users/omniauth_callbacks#failure", via: [:get, :post] resources :clicks do collection do @@ -170,8 +170,8 @@ Discourse::Application.routes.draw do get 'category/:category.rss' => 'list#category_feed', format: :rss, as: 'category_feed' get 'category/:category' => 'list#category' - get 'category/:category' => 'list#category', as: 'category' - get 'category/:category/more' => 'list#category', as: 'category' + get 'category/:category' => 'list#category' + get 'category/:category/more' => 'list#category' get 'categories' => 'categories#index' # We've renamed popular to latest. If people access it we want a permanent redirect. @@ -241,9 +241,9 @@ Discourse::Application.routes.draw do get 'robots.txt' => 'robots_txt#index' [:latest, :hot, :unread, :new, :favorited, :read, :posted].each do |filter| - root to: "list##{filter}", constraints: HomePageConstraint.new("#{filter}") + root to: "list##{filter}", constraints: HomePageConstraint.new("#{filter}"), :as => "list_#{filter}" end # special case for categories - root to: "categories#index", constraints: HomePageConstraint.new("categories") + root to: "categories#index", constraints: HomePageConstraint.new("categories"), :as => "categories_index" end diff --git a/spec/controllers/static_controller_spec.rb b/spec/controllers/static_controller_spec.rb index 8928118f4..c97c0c233 100644 --- a/spec/controllers/static_controller_spec.rb +++ b/spec/controllers/static_controller_spec.rb @@ -48,7 +48,7 @@ describe StaticController do context 'without a redirect path' do it 'redirects to the root url' do xhr :post, :enter - expect(response).to redirect_to root_path + expect(response).to redirect_to '/' end end @@ -62,7 +62,7 @@ describe StaticController do context 'when the redirect path is the login page' do it 'redirects to the root url' do xhr :post, :enter, redirect: login_path - expect(response).to redirect_to root_path + expect(response).to redirect_to '/' end end end