diff --git a/cluster/test/commands_on_transactions_test.rb b/cluster/test/commands_on_transactions_test.rb index 7935ba4a..182144f5 100644 --- a/cluster/test/commands_on_transactions_test.rb +++ b/cluster/test/commands_on_transactions_test.rb @@ -38,8 +38,11 @@ def test_unwatch end def test_watch - assert_raises(Redis::CommandError, "CROSSSLOT Keys in request don't hash to the same slot") do - redis.watch('key1', 'key2') + assert_raises(Redis::Cluster::TransactionConsistencyError) do + redis.watch('key1', 'key2') do |tx| + tx.set('key1', '1') + tx.set('key2', '2') + end end assert_equal 'OK', redis.watch('{key}1', '{key}2') diff --git a/test/helper.rb b/test/helper.rb index dc4ebf33..d3fb5290 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -174,7 +174,7 @@ def version def with_acl admin = _new_client admin.acl('SETUSER', 'johndoe', 'on', - '+ping', '+select', '+command', '+cluster|slots', '+cluster|nodes', + '+ping', '+select', '+command', '+cluster|slots', '+cluster|nodes', '+readonly', '>mysecret') yield('johndoe', 'mysecret') ensure