Add Test for match state change

This commit is contained in:
Daniel Schädler 2019-04-16 20:18:50 +02:00
parent 0a13299fca
commit 813ab04704
1 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,12 @@ RSpec.describe MatchScoresController, type: :controller do
expect(@match_score.points).to eq(valid_update[:points]) expect(@match_score.points).to eq(valid_update[:points])
end end
it 'updates the matches state' do
put :update, params: { id: @match_score.to_param }.merge(valid_update)
@match_score.reload
expect(@match_score.match.state).to eq('in_progress')
end
it 'renders a response with the updated team' do it 'renders a response with the updated team' do
put :update, params: { id: @match_score.to_param }.merge(valid_update) put :update, params: { id: @match_score.to_param }.merge(valid_update)
expect(response).to be_successful expect(response).to be_successful