diff --git a/decidim-blogs/spec/events/decidim/blogs/create_post_event_spec.rb b/decidim-blogs/spec/events/decidim/blogs/create_post_event_spec.rb index 48ada08df08a..940cb1de9c7e 100644 --- a/decidim-blogs/spec/events/decidim/blogs/create_post_event_spec.rb +++ b/decidim-blogs/spec/events/decidim/blogs/create_post_event_spec.rb @@ -11,6 +11,14 @@ it_behaves_like "a simple event" describe "email_subject" do + let(:assembly) { create(:assembly, organization: organization, title: { en: "It's a test" }) } + let(:blogs_component) { create :component, :published, name: { en: "Blogs" }, participatory_space: assembly, manifest_name: :blogs } + + before do + resource.component = blogs_component + resource.save! + end + it "is generated correctly" do expect(subject.email_subject).to eq("New post published in #{participatory_space_title}") end diff --git a/decidim-core/lib/decidim/events/simple_event.rb b/decidim-core/lib/decidim/events/simple_event.rb index 4d60192d1341..7c3b82c6ce1e 100644 --- a/decidim-core/lib/decidim/events/simple_event.rb +++ b/decidim-core/lib/decidim/events/simple_event.rb @@ -38,6 +38,7 @@ def email_subject def email_subject_i18n_options sanitized_values = { resource_title: decidim_sanitize(resource_title) } sanitized_values[:mentioned_proposal_title] = decidim_sanitize(mentioned_proposal_title) if i18n_options.has_key?(:mentioned_proposal_title) + sanitized_values[:participatory_space_title] = decidim_sanitize(participatory_space_title) if i18n_options.has_key?(:participatory_space_title) i18n_options.merge(sanitized_values) end