Sha256: 1b3a1064c16c348662df7d57d1fce8ec7e7a9f9505da09957824117a6ece9363

Contents?: true

Size: 827 Bytes

Versions: 17

Compression:

Stored size: 827 Bytes

Contents

describe ActivityNotification::NotifyAllJob, type: :job do
  before do
    ActiveJob::Base.queue_adapter = :test
    ActiveJob::Base.queue_adapter.enqueued_jobs.clear
    @author_user = create(:confirmed_user)
    @user        = create(:confirmed_user)
    @article     = create(:article, user: @author_user)
    @comment     = create(:comment, article: @article, user: @user)
  end

  describe "#perform_later" do
    it "generates notifications" do
      expect {
        ActivityNotification::NotifyAllJob.perform_later([@author_user, @user], @comment)
      }.to have_enqueued_job
    end

    it "generates notifications once" do
      ActivityNotification::NotifyAllJob.perform_later([@author_user, @user], @comment)
      expect(ActivityNotification::NotifyAllJob).to have_been_enqueued.exactly(:once)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
activity_notification-2.3.3 spec/jobs/notify_all_job_spec.rb
activity_notification-2.3.2 spec/jobs/notify_all_job_spec.rb
activity_notification-2.3.1 spec/jobs/notify_all_job_spec.rb
activity_notification-2.3.0 spec/jobs/notify_all_job_spec.rb
activity_notification-2.2.4 spec/jobs/notify_all_job_spec.rb
activity_notification-2.2.3 spec/jobs/notify_all_job_spec.rb
activity_notification-2.2.2 spec/jobs/notify_all_job_spec.rb
activity_notification-2.2.1 spec/jobs/notify_all_job_spec.rb
activity_notification-2.2.0 spec/jobs/notify_all_job_spec.rb
activity_notification-2.1.4 spec/jobs/notify_all_job_spec.rb
activity_notification-2.1.3 spec/jobs/notify_all_job_spec.rb
activity_notification-2.1.2 spec/jobs/notify_all_job_spec.rb
activity_notification-2.1.1 spec/jobs/notify_all_job_spec.rb
activity_notification-2.1.0 spec/jobs/notify_all_job_spec.rb
activity_notification-2.0.0 spec/jobs/notify_all_job_spec.rb
activity_notification-1.7.1 spec/jobs/notify_all_job_spec.rb
activity_notification-1.7.0 spec/jobs/notify_all_job_spec.rb