Add routing to StatisticsController

This commit is contained in:
Thor77 2019-05-13 14:19:28 +02:00
parent 99bfe6ed70
commit b307abfc43
No known key found for this signature in database
GPG Key ID: 5051E71B46AA669A
2 changed files with 14 additions and 1 deletions

View File

@ -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

View File

@ -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