test/coordinator_test.rb in dynflow-0.8.11 vs test/coordinator_test.rb in dynflow-0.8.12
- old
+ new
@@ -30,9 +30,15 @@
world.coordinator.release_by_owner("world:#{world.id}")
world.coordinator.acquire(lock) # expected no error raised
tester.finish
end
+ it 'supports checking about locks' do
+ world.coordinator.acquire(Coordinator::AutoExecuteLock.new(world))
+ locks = world.coordinator.find_locks(Coordinator::AutoExecuteLock.unique_filter)
+ locks.map(&:world_id).must_equal([world.id])
+ end
+
it 'deserializes the data from the adapter when searching for locks' do
lock = Coordinator::AutoExecuteLock.new(world)
world.coordinator.acquire(lock)
found_locks = world.coordinator.find_locks(owner_id: lock.owner_id)
found_locks.size.must_equal 1