Commit c1479fef2687c0abf21b65dab6b230cd48cc6968

Authored by Rafael Manzo
1 parent 5e08e4ec

Removing unused reading routes

config/routes.rb
@@ -13,7 +13,7 @@ Mezuro::Application.routes.draw do @@ -13,7 +13,7 @@ Mezuro::Application.routes.draw do
13 end 13 end
14 14
15 resources :reading_groups do 15 resources :reading_groups do
16 - resources :readings 16 + resources :readings, except: [:index, :show]
17 end 17 end
18 18
19 #resources :modules 19 #resources :modules
spec/routing/readings_routing_spec.rb
@@ -8,13 +8,13 @@ describe ReadingsController do @@ -8,13 +8,13 @@ describe ReadingsController do
8 to(controller: :readings, action: :new, reading_group_id: 1) } 8 to(controller: :readings, action: :new, reading_group_id: 1) }
9 it { should route(:get, '/reading_groups/1/readings/1/edit'). 9 it { should route(:get, '/reading_groups/1/readings/1/edit').
10 to(controller: :readings, action: :edit, reading_group_id: 1, id: 1) } 10 to(controller: :readings, action: :edit, reading_group_id: 1, id: 1) }
11 - it { should route(:get, '/reading_groups/1/readings/1'). 11 + it { should_not route(:get, '/reading_groups/1/readings/1').
12 to(controller: :readings, action: :show, reading_group_id: 1, id: 1) } 12 to(controller: :readings, action: :show, reading_group_id: 1, id: 1) }
13 it { should route(:delete, '/reading_groups/1/readings/1'). 13 it { should route(:delete, '/reading_groups/1/readings/1').
14 to(controller: :readings, action: :destroy, reading_group_id: 1, id: 1) } 14 to(controller: :readings, action: :destroy, reading_group_id: 1, id: 1) }
15 it { should route(:put, '/reading_groups/1/readings/1'). 15 it { should route(:put, '/reading_groups/1/readings/1').
16 to(controller: :readings, action: :update, reading_group_id: 1, id: 1) } 16 to(controller: :readings, action: :update, reading_group_id: 1, id: 1) }
17 - it { should route(:get, '/reading_groups/1/readings'). 17 + it { should_not route(:get, '/reading_groups/1/readings').
18 to(controller: :readings, action: :index, reading_group_id: 1) } 18 to(controller: :readings, action: :index, reading_group_id: 1) }
19 end 19 end
20 end 20 end