Skip to content

Commit

Permalink
Fix spec to use API method instead of #reload
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Sep 13, 2010
1 parent b15e93d commit a92ee5c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/delayed/backend/shared_spec.rb
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a92ee5c

Please sign in to comment.