I see this code:
Event.delay.create!(
  event_type: event_type,
  description: 'Automatically populated',
  date: Time.now.utc,
  eventable_id: subscription.id,
  eventable_type: subscription.class.name,
  app_context: app_context)
And this is the associated test:
  it 'logs events' do
    expect(Event).to receive(:delay).and_call_original
    subject
  end
What is the and_call_original method? What is the delay method?
The :delay method is probably from Delayed Job, a queueing framework:
Delayed Job Github Site
'and_call_original' is a delegator in the rspec framework.
From rspec mocks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With