Commit b3409871e41ee674d5590c743fe8418bc3270b68
Committed by
Rafael Manzo
1 parent
3d5f34bf
Exists in
colab
and in
4 other branches
RepositoryController#index route
Signed off by: Rafael Reggiani Manzo <rr.manzo@gmail.com>
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
config/routes.rb
... | ... | @@ -7,7 +7,7 @@ Rails.application.routes.draw do |
7 | 7 | resources :repositories, only: [:new, :create] |
8 | 8 | end |
9 | 9 | |
10 | - resources :repositories, except: [:update, :index] | |
10 | + resources :repositories, except: [:update] | |
11 | 11 | get '/repositories/:id/modules/:module_result_id' => 'repositories#show', as: :repository_module |
12 | 12 | get '/repositories/:id/state' => 'repositories#state', as: :repository_state |
13 | 13 | get '/repositories/:id/state_with_date' => 'repositories#state_with_date', as: :repository_state_with_date | ... | ... |
spec/routing/repositories_routing_spec.rb
... | ... | @@ -4,6 +4,8 @@ describe RepositoriesController, :type => :routing do |
4 | 4 | describe "routing" do |
5 | 5 | it { is_expected.to route(:post, '/repositories'). |
6 | 6 | to(controller: :repositories, action: :create) } |
7 | + it { is_expected.to route(:get, '/repositories'). | |
8 | + to(controller: :repositories, action: :index) } | |
7 | 9 | it { is_expected.to route(:get, '/repositories/new'). |
8 | 10 | to(controller: :repositories, action: :new) } |
9 | 11 | it { is_expected.to route(:get, '/repositories/1/edit'). |
... | ... | @@ -16,8 +18,6 @@ describe RepositoriesController, :type => :routing do |
16 | 18 | to(controller: :repositories, action: :destroy, id: 1) } |
17 | 19 | it { is_expected.to route(:put, '/repositories/1'). |
18 | 20 | to(controller: :repositories, action: :update, id: 1) } |
19 | - it { is_expected.not_to route(:get, '/repositories'). | |
20 | - to(controller: :repositories, action: :index) } | |
21 | 21 | it { is_expected.to route(:get, '/repositories/1/state'). |
22 | 22 | to(controller: :repositories, action: :state, id: 1) } |
23 | 23 | it { is_expected.to route(:get, '/repositories/1/state_with_date'). | ... | ... |