spec/models/massive/step_spec.rb in massive-0.1.0 vs spec/models/massive/step_spec.rb in massive-0.1.1
- old
+ new
@@ -36,11 +36,18 @@
Massive::Step.new.calculate_total_count.should eq(1234)
end
end
describe "#enqueue" do
+ before { step.stub(:reload).and_return(step) }
+
it "enqueues itself, passing ids as strings" do
Resque.should_receive(:enqueue).with(step.class, step.process.id.to_s, step.id.to_s)
+ step.enqueue
+ end
+
+ it "sends a :enqueued notification" do
+ step.should_receive(:notify).with(:enqueued)
step.enqueue
end
context "when a subclass redefines calculate_total_count" do
subject(:step) { CustomStep.new }