Add spec for tournament-creation with invalid team

This commit is contained in:
Thor77 2019-04-16 13:18:50 +02:00
parent 81985415b2
commit a14a5224e5
1 changed files with 7 additions and 0 deletions

View File

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