From f480dbbacc68180f5a6b12f0fc62c62b2f6683cb Mon Sep 17 00:00:00 2001 From: Alexandru Emil Lupu Date: Tue, 30 Jan 2024 10:19:13 +0200 Subject: [PATCH] Change the event (#20) * Change the event * Fix specs --- .../overrides/notify_proposal_answer.rb | 2 +- .../decidim/proposals/admin/notify_proposal_answer_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/decidim/custom_proposal_states/overrides/notify_proposal_answer.rb b/lib/decidim/custom_proposal_states/overrides/notify_proposal_answer.rb index 825bc20..1048d44 100644 --- a/lib/decidim/custom_proposal_states/overrides/notify_proposal_answer.rb +++ b/lib/decidim/custom_proposal_states/overrides/notify_proposal_answer.rb @@ -19,7 +19,7 @@ def notify_followers return unless proposal.proposal_state.notifiable? Decidim::EventsManager.publish( - event: "decidim.events.proposals.proposal_state_changed", + event: "decidim.events.custom_proposal_states.proposal_state_changed", event_class: Decidim::CustomProposalStates::ProposalStateChangedEvent, resource: proposal, affected_users: proposal.notifiable_identities, diff --git a/spec/proposals/commands/decidim/proposals/admin/notify_proposal_answer_spec.rb b/spec/proposals/commands/decidim/proposals/admin/notify_proposal_answer_spec.rb index 801b73b..b792e25 100644 --- a/spec/proposals/commands/decidim/proposals/admin/notify_proposal_answer_spec.rb +++ b/spec/proposals/commands/decidim/proposals/admin/notify_proposal_answer_spec.rb @@ -30,7 +30,7 @@ module Admin expect(Decidim::EventsManager) .to receive(:publish) .with( - event: "decidim.events.proposals.proposal_state_changed", + event: "decidim.events.custom_proposal_states.proposal_state_changed", event_class: Decidim::CustomProposalStates::ProposalStateChangedEvent, resource: proposal, affected_users: match_array([proposal.creator_author]), @@ -56,7 +56,7 @@ module Admin expect(Decidim::EventsManager) .to receive(:publish) .with( - event: "decidim.events.proposals.proposal_state_changed", + event: "decidim.events.custom_proposal_states.proposal_state_changed", event_class: Decidim::CustomProposalStates::ProposalStateChangedEvent, resource: proposal, affected_users: match_array([proposal.creator_author]),