Skip to content
Browse files

Fix spec to use API method instead of #reload

  • Loading branch information...
1 parent b15e93d commit a92ee5ced9ebf5f7d54c3042e7a1721f5018d520 @bkeepers bkeepers committed Sep 13, 2010
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/delayed/backend/shared_spec.rb
View
9 lib/delayed/backend/shared_spec.rb
@@ -164,7 +164,7 @@ def create_job(opts = {})
end
end
- context "when another worker is already performing an task, it" do
+ context "when another worker is already performing a task, it" do
before :each do
@job = described_class.create :payload_object => SimpleJob.new, :locked_by => 'worker1', :locked_at => described_class.db_time_now - 5.minutes
end
@@ -181,10 +181,9 @@ def create_job(opts = {})
@job.locked_at = described_class.db_time_now - 5.hours
@job.save
- @job.lock_exclusively! 4.hours, 'worker2'
- @job.reload
- @job.locked_by.should == 'worker2'
- @job.locked_at.should > (described_class.db_time_now - 1.minute)
+ @job.lock_exclusively!(4.hours, 'worker2').should be_true
+
+ described_class.find_available('worker2').should_not be_empty
end
it "should not be found by another worker" do

0 comments on commit a92ee5c

Please sign in to comment.
Something went wrong with that request. Please try again.