Skip to content

Commit 114157d

Browse files
author
Monorail CI check running in Buildkite
committed
more fix
1 parent 3a4408e commit 114157d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/models/shipit/stack_test.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,13 +751,17 @@ def self.deliver(event, stack, payload)
751751

752752
test "#locked? updates lock if LockProvider finds lock" do
753753
class LockedProvider < LockProviders::Provider
754+
def initialize(stack)
755+
@stack = stack
756+
end
757+
754758
def try_lock
755-
Stack.find_each { |s| s.update(lock_reason: "test lock") }
759+
@stack.lock("test lock", AnonymousUser.new)
756760
end
757761
end
758762

759763
refute @stack.reload.locked?
760-
LockProviders::Config.configure { |c| c.provider = LockedProvider.new }
764+
LockProviders::Config.configure { |c| c.provider = LockedProvider.new(@stack) }
761765
assert @stack.locked?
762766
assert_equal "test lock", @stack.lock_reason
763767
end

0 commit comments

Comments
 (0)