Skip to content

Commit

Permalink
[webui] Redirects /apidocs to /apidocs/index
Browse files Browse the repository at this point in the history
This should fix #952.
  • Loading branch information
eduardoj committed Mar 7, 2017
1 parent 9530709 commit 1d3ae6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/config/routes.rb
Expand Up @@ -345,7 +345,8 @@ def self.public_or_about_path?(request)
resources :comments, constraints: cons, only: [:create, :destroy], controller: 'webui/comments'

### /apidocs
get 'apidocs(/index)' => 'webui/apidocs#index'
get 'apidocs', to: redirect('/apidocs/index')
get 'apidocs/(index)' => 'webui/apidocs#index', as: 'apidocs_index'
end

### /worker
Expand Down
8 changes: 8 additions & 0 deletions src/api/spec/requests/webui/apidocs_spec.rb
@@ -0,0 +1,8 @@
require 'rails_helper'

RSpec.describe "Apidocs", type: :request do
it "Redirects /apidocs to /apidocs/index" do
get "/apidocs"
expect(response).to redirect_to(apidocs_index_path)
end
end

0 comments on commit 1d3ae6e

Please sign in to comment.