Skip to content

Commit

Permalink
Corrige la création d'événement depuis l'API
Browse files Browse the repository at this point in the history
  • Loading branch information
shanser authored and etienneCharignon committed Mar 10, 2021
1 parent 2b7928b commit b89c555
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/actions/cree_evenement_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def call

next unless evenement.nom == FIN_SITUATION

restitution = FabriqueRestitution.instancie partie.id
restitution = FabriqueRestitution.instancie partie
restitution.persiste
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/nettoyage.rake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace :nettoyage do
Partie
.where(situation: situation)
.find_each do |partie|
restitution = FabriqueRestitution.instancie partie.id
restitution = FabriqueRestitution.instancie partie
restitution.persiste if restitution.termine?
nombre_partie -= 1
logger.info "reste #{nombre_partie}"
Expand All @@ -88,7 +88,7 @@ namespace :nettoyage do
evenements = Evenement.where(partie: partie)
next if evenements.where(nom: 'finSituation').exists?

restitution = FabriqueRestitution.instancie partie.id
restitution = FabriqueRestitution.instancie partie
next unless restitution.termine?

dernier_evenement = evenements.order(:date).last
Expand Down
2 changes: 1 addition & 1 deletion spec/actions/cree_evenement_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
let(:restitution) { double }

before do
allow(FabriqueRestitution).to receive(:instancie).with(partie.id).and_return restitution
allow(FabriqueRestitution).to receive(:instancie).with(partie).and_return restitution
end

context "sauve l'évenement" do
Expand Down
2 changes: 1 addition & 1 deletion spec/tasks/ajoute_evenements_termines_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
include_context 'rake'

before do
allow(FabriqueRestitution).to receive(:instancie).with(partie.id).and_return restitution
allow(FabriqueRestitution).to receive(:instancie).with(partie).and_return restitution
end

let!(:partie) { create :partie }
Expand Down
2 changes: 1 addition & 1 deletion spec/tasks/recalcule_metriques_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
context 'appelé avec un nom de situation valide' do
before do
allow(logger).to receive :info
allow(FabriqueRestitution).to receive(:instancie).with(partie.id).and_return restitution
allow(FabriqueRestitution).to receive(:instancie).with(partie).and_return restitution
ENV['SITUATION'] = 'tri'
end

Expand Down

0 comments on commit b89c555

Please sign in to comment.