Sha256: 922180b989d70318aec2c2133a8c6b791687ff265b9c36c5fd69dbede2502c3d

Contents?: true

Size: 1.69 KB

Versions: 5

Compression:

Stored size: 1.69 KB

Contents

# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "spec_helper"

module Decidim
  module Comments
    describe CommentNotificationMailer, type: :mailer do
      let(:organization) { create(:organization) }
      let(:participatory_process) { create(:participatory_process, organization: organization) }
      let(:feature) { create(:feature, participatory_process: participatory_process) }
      let(:commentable_author) { create(:user, organization: organization) }
      let(:commentable) { create(:dummy_resource, author: commentable_author, feature: feature) }
      let(:user) { create(:user, organization: organization) }
      let(:author) { create(:user, organization: organization) }
      let(:comment) { create(:comment, author: author, commentable: commentable) }
      let(:reply) { create(:comment, author: author, commentable: comment) }

      describe "comment_created" do
        let(:mail) { described_class.comment_created(user, comment, commentable) }

        let(:subject) { "Tens un nou comentari" }
        let(:default_subject) { "You have a new comment" }

        let(:body) { "Hi ha un nou comentari d" }
        let(:default_body) { "There is a new comment" }

        include_examples "user localised email"
      end

      describe "reply_created" do
        let(:mail) { described_class.reply_created(user, reply, comment, commentable) }

        let(:subject) { "Tens una nova resposta del teu comentari" }
        let(:default_subject) { "You have a new reply of your comment" }

        let(:body) { "Hi ha una nova resposta de" }
        let(:default_body) { "There is a new reply of your comment" }

        include_examples "user localised email"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-0.4.4 decidim-comments/spec/mailers/comment_notification_mailer_spec.rb
decidim-0.4.3 decidim-comments/spec/mailers/comment_notification_mailer_spec.rb
decidim-0.4.2 decidim-comments/spec/mailers/comment_notification_mailer_spec.rb
decidim-0.4.1 decidim-comments/spec/mailers/comment_notification_mailer_spec.rb
decidim-0.4.0 decidim-comments/spec/mailers/comment_notification_mailer_spec.rb