Test timer_end is in show tournament

This commit is contained in:
Daniel Schädler 2025-03-14 12:47:06 +01:00
parent f7dc8411f4
commit 9f1807ab4b
1 changed files with 5 additions and 1 deletions

View File

@ -100,7 +100,11 @@ RSpec.describe TournamentsController, type: :controller do
it 'returns the requested tournament' do
get :show, params: { id: @tournament.to_param }
expect(deserialize_response(response)[:id].to_i).to eq(@tournament.id)
json = deserialize_response(response)
expect(json[:id].to_i).to eq(@tournament.id)
expected_keys = %i[id name code public description playoff_teams_amount instant_finalists_amount intermediate_round_participants_amount timer_end owner_username stages teams]
expect(json.keys).to match_array(expected_keys)
expect(json).to eq(TournamentSerializer.new(@tournament).as_json)
end
context 'with simple=true parameter' do