Sha256: b3f2d0b2e5d94a856d8880196193adfbf45506cca5a94ddd1e84302fe76f41b3

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

require 'spec_helper'

describe ObjectPerformLater do
  let(:enabled) do
    { 'enabled' => true } 
  end
  let(:disabled) do
    { 'enabled' => false }
  end

  it "should insert a task into resque when the config is enabled" do
    Resque.redis = $redis

    ResquePerformLater.stub!(:config).and_return(enabled)
    User.perform_later(:generic, :get_metadata)

    Resque.peek(:generic, 0, 20).length.should == 1
  end

  it "should send the method on the class when the config is disabled" do
    ResquePerformLater.stub!(:config).and_return(disabled)
    
    User.should_receive(:get_metadata)
    User.perform_later(:generic, :get_metadata)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
perform_later-0.0.4 spec/lib/object_perform_later_spec.rb