Skip to content

Commit 029047b

Browse files
committed
switch to versioned documentation
1 parent 026d817 commit 029047b

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

app/controllers/documentation_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
class DocumentationController < ApplicationController
22
def index
3+
redirect_to controller: :documentation, action: :api_v1
4+
end
5+
6+
def api_v1
37
@applications = Doorkeeper::Application.all
48
render layout: false
59
end

config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
mount API::Base => '/api'
44
resources :documentation, only: [:index] do
55
collection do
6+
get :api_v1
67
get :o2c
78
get :authorize
89
end

spec/controllers/documentation_controller_spec.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55
before do
66
get :index
77
end
8+
it { should respond_with(:redirect) }
9+
it { should redirect_to(api_v1_documentation_index_path) }
10+
end
11+
12+
describe 'view api_v1 documentation' do
13+
before do
14+
get :api_v1
15+
end
816
it { should respond_with(:success) }
9-
it { should render_template(:index) }
10-
end
17+
it { should render_template(:api_v1) }
18+
end
1119
end

0 commit comments

Comments
 (0)