diff --git a/config/routes.rb b/config/routes.rb index 16b79b6..10cafbf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,6 +8,8 @@ Rails.application.routes.draw do resources :matches, only: %i[show update] resources :teams, only: %i[show update] - resources :tournaments + resources :tournaments do + resources :statistics, only: %i[index] + end resources :match_scores, only: %i[show update] end diff --git a/spec/routing/statistics_routing_spec.rb b/spec/routing/statistics_routing_spec.rb new file mode 100644 index 0000000..f2f6f11 --- /dev/null +++ b/spec/routing/statistics_routing_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe StatisticsController, type: :routing do + describe 'routing' do + it 'routes to #index' do + expect(get: '/tournaments/1/statistics').to route_to('statistics#index', tournament_id: '1') + end + end +end