Sha256: 8c0363c99a2b4f91ba94e98dca3e8d475b46eb34bfd926d44379115728dd7933

Contents?: true

Size: 1.02 KB

Versions: 3

Compression:

Stored size: 1.02 KB

Contents

require "test_helper"

module Devise
  module Async
    module Backend
      describe "Backburner" do
        it "enqueues job" do
          ::Backburner.expects(:enqueue).with(Backburner, :mailer_method, "User", 123, {})
          Backburner.enqueue(:mailer_method, "User", 123, {})
        end

        it "delegates to devise mailer when delivering" do
          user = create_user
          ActionMailer::Base.deliveries = []
          Backend::Backburner.perform(:confirmation_instructions, "User", user.id, {})
          ActionMailer::Base.deliveries.size.must_equal 1
        end

        describe ".queue_priority" do
          it "returns the right priority when set" do
            Devise::Async.priority = 15
            Backburner.queue_priority.must_equal 15
            Devise::Async.priority = nil
          end

          it "returns default priority when no priority is set" do
            Backburner.queue_priority.must_equal ::Backburner.configuration.default_priority
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
devise-async-0.10.2 test/devise/async/backend/backburner_test.rb
devise-async-0.10.1 test/devise/async/backend/backburner_test.rb
devise-async-0.10.1.alpha test/devise/async/backend/backburner_test.rb