diff --git a/config/routes.rb b/config/routes.rb index abf2475f8..bc5d15dce 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -295,14 +295,10 @@ Rails.application.routes.draw do resource :user_upgrade, :only => [:new, :create, :show] resources :user_feedbacks resources :user_name_change_requests, only: [:new, :create, :show, :index] - resources :wiki_pages do - member do - put :revert - end - collection do - get :search - get :show_or_new - end + resources :wiki_pages, id: /.+?(?=\.json|\.xml|\.html)|.+/ do + put :revert, on: :member + get :search, on: :collection + get :show_or_new, on: :collection end resources :wiki_page_versions, :only => [:index, :show, :diff] do collection do diff --git a/test/functional/wiki_pages_controller_test.rb b/test/functional/wiki_pages_controller_test.rb index 9e7803f42..9de94df07 100644 --- a/test/functional/wiki_pages_controller_test.rb +++ b/test/functional/wiki_pages_controller_test.rb @@ -86,6 +86,19 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest get wiki_page_path(@wiki_page.id) assert_redirected_to wiki_page_path(@wiki_page.title) end + + should "work for a title containing dots" do + as(@user) { create(:wiki_page, title: "...") } + + get wiki_page_path("...") + assert_response :success + + get wiki_page_path("....json") + assert_response :success + + get wiki_page_path("....xml") + assert_response :success + end end context "show_or_new action" do