Sha256: b442423149273eb3b6aab1d88baf4e09d5a3f0df359de15d07c083b34d9e6b73
Contents?: true
Size: 1.15 KB
Versions: 13
Compression:
Stored size: 1.15 KB
Contents
require 'spec_helper' module CurationConcerns module Workflow RSpec.describe NotificationGenerator, no_clean: true do let(:workflow) { Sipity::Workflow.new(id: 1) } let(:recipients) { { to: 'creating_user', cc: 'advising', bcc: "data_observing" } } context '#call' do context 'with for a workflow action' do let(:notification_configuration) do NotificationConfigurationParameter.build_from_workflow_action_configuration( workflow_action: 'an_action', config: recipients.merge(name: 'the_weasel', notification_type: 'email') ) end it 'will generate the requisite entries' do workflow_action = Sipity::WorkflowAction.create!(workflow_id: workflow.id, name: 'an_action') expect do described_class.call(workflow: workflow, notification_configuration: notification_configuration) end.to change { Sipity::Notification.count }.by(1) .and change { Sipity::NotificationRecipient.count }.by(3) .and change { workflow_action.notifiable_contexts.count }.by(1) end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems