Create a new match to hopefully fix random failure of this test
This commit is contained in:
parent
42ee77d0ee
commit
142c7c3d53
|
|
@ -161,15 +161,20 @@ RSpec.describe MatchesController, type: :controller do
|
||||||
|
|
||||||
context 'PopulateMatchBelowAndSave fails' do
|
context 'PopulateMatchBelowAndSave fails' do
|
||||||
before do
|
before do
|
||||||
expect(PopulateMatchBelowAndSave).to receive(:call).once.with(match: @running_playoff_match)
|
@running_match = create(:running_playoff_match)
|
||||||
|
expect(PopulateMatchBelowAndSave).to receive(:call).once.with(match: @running_match)
|
||||||
.and_return(context)
|
.and_return(context)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when unsuccessful' do
|
context 'when unsuccessful' do
|
||||||
|
before(:each) do
|
||||||
|
apply_authentication_headers_for @running_match.owner
|
||||||
|
end
|
||||||
|
|
||||||
let(:context) { double(:context, success?: false) }
|
let(:context) { double(:context, success?: false) }
|
||||||
|
|
||||||
it 'returns unprocessable entity' do
|
it 'returns unprocessable entity' do
|
||||||
put :update, params: { id: @running_playoff_match.to_param }.merge(finished)
|
put :update, params: { id: @running_match.to_param }.merge(finished)
|
||||||
expect(response).to have_http_status(:unprocessable_entity)
|
expect(response).to have_http_status(:unprocessable_entity)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue