From a14a5224e5f8e19a747176ef81f5b3a3d687570b Mon Sep 17 00:00:00 2001 From: Thor77 Date: Tue, 16 Apr 2019 13:18:50 +0200 Subject: [PATCH] Add spec for tournament-creation with invalid team --- spec/controllers/tournaments_controller_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/controllers/tournaments_controller_spec.rb b/spec/controllers/tournaments_controller_spec.rb index 772a5b3..88d6a6b 100644 --- a/spec/controllers/tournaments_controller_spec.rb +++ b/spec/controllers/tournaments_controller_spec.rb @@ -142,6 +142,13 @@ RSpec.describe TournamentsController, type: :controller do end.to change(Team, :count).by(data[:teams].count) end end + + context 'with invalid parameters' do + it 'renders an unprocessable entity response' do + put :create, params: { teams: [1, 2, 3] } + expect(response).to have_http_status(:unprocessable_entity) + end + end end end