Sha256: 6394803dac7300d789aebbeae9cae3a241f4469d8d6af7c969a86233c4a20f05

Contents?: true

Size: 513 Bytes

Versions: 5

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true
RSpec.describe Timeful::DeliverActivityToSubscribersJob do
  subject { -> { described_class.perform_now(activity) } }

  let(:subscriber) { build_stubbed(:user) }
  let(:activity) { build_stubbed(:activity) }

  before { allow(activity).to receive(:subscribers).and_return([subscriber]) }

  it 'creates a feed item for each subscriber of the activity' do
    expect(subscriber.feed_items).to receive(:create!)
      .with(activity: activity)
      .once

    subject.call
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
timeful-2.1.0 spec/jobs/timeful/deliver_activity_to_subscribers_job_spec.rb
timeful-2.0.0 spec/jobs/timeful/deliver_activity_to_subscribers_job_spec.rb
timeful-1.1.0 spec/jobs/timeful/deliver_activity_to_subscribers_job_spec.rb
timeful-1.0.0 spec/jobs/timeful/deliver_activity_to_subscribers_job_spec.rb
timeful-0.0.1 spec/jobs/timeful/deliver_activity_to_subscribers_job_spec.rb