Sha256: 648802f8f05cf6d2f15904523cabf80d1f3a1e27f42470332d67ea05513510bf
Contents?: true
Size: 786 Bytes
Versions: 20
Compression:
Stored size: 786 Bytes
Contents
# frozen_string_literal: true require "spec_helper" module Decidim module Admin describe NewsletterDeliveryJob do let(:user) { create(:user) } let(:organization) { create(:organization) } let(:newsletter) { create(:newsletter, organization: organization, total_deliveries: 0) } it "delivers a newsletter to a single user" do NewsletterDeliveryJob.perform_now(user, newsletter) expect(last_email.subject).to include(newsletter.subject[I18n.locale.to_s]) expect(last_email.to).to include(user.email) end it "increments the delivery count" do expect do NewsletterDeliveryJob.perform_now(user, newsletter) end.to change { newsletter.reload.total_deliveries }.by(1) end end end end
Version data entries
20 entries across 20 versions & 1 rubygems