turniere-backend/spec/routing/tournaments_routing_spec.rb

46 lines
1.3 KiB
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe TournamentsController, type: :routing do
describe 'routing' do
it 'routes to #index' do
expect(get: '/tournaments').to route_to('tournaments#index')
end
it 'routes to #show' do
expect(get: '/tournaments/1').to route_to('tournaments#show', id: '1')
end
it 'routes to #create' do
expect(post: '/tournaments').to route_to('tournaments#create')
end
it 'routes to #update via PUT' do
expect(put: '/tournaments/1').to route_to('tournaments#update', id: '1')
end
it 'routes to #update via PATCH' do
expect(patch: '/tournaments/1').to route_to('tournaments#update', id: '1')
end
it 'routes to #destroy' do
expect(delete: '/tournaments/1').to route_to('tournaments#destroy', id: '1')
end
it 'routes to #sync_state' do
expect(patch: '/tournaments/1/sync_state').to route_to('tournaments#sync_state', id: '1')
end
it 'routes to #start_next_group_matches' do
expect(patch: '/tournaments/1/start_next_group_matches').to(
route_to('tournaments#start_next_group_matches', id: '1')
)
end
it 'routes to #test_sync' do
expect(post: '/tournaments/1/test_sync').to route_to('tournaments#test_sync', id: '1')
end
end
end