Add test for empty team hashes

This commit is contained in:
Thor77 2019-05-02 14:34:03 +02:00 committed by Malaber
parent ae29427e5d
commit f93c714e1a
1 changed files with 9 additions and 0 deletions

View File

@ -233,6 +233,15 @@ RSpec.describe TournamentsController, type: :controller do
expect(response).to have_http_status(:unprocessable_entity) expect(response).to have_http_status(:unprocessable_entity)
end end
end end
context 'with empty team objects' do
it 'renders an unprocessable entity response' do
data = create_group_tournament_data
data[:teams] = [{ group: 1 }, { group: 1 }, { group: 2 }, { group: 2 }]
post :create, params: data
expect(response).to have_http_status(:unprocessable_entity)
end
end
end end
end end