>From bdc03154c4e5990813e233c2e4874d8b562ad9ff Mon Sep 17 00:00:00 2001
From: Michael Klishin <michaelklishin@icloud.com>
Date: Mon, 15 Jun 2026 11:56:09 -0700
Subject: [PATCH] Fixes #739

---
 .../integration/basic_reject_spec.rb          | 27 +++++++------------
 1 file changed, 9 insertions(+), 18 deletions(-)

--- a/spec/higher_level_api/integration/basic_reject_spec.rb
+++ b/spec/higher_level_api/integration/basic_reject_spec.rb
@@ -14,7 +14,7 @@
   context "with requeue = true" do
     it "requeues a message" do
       ch = connection.create_channel
-      q  = ch.queue("bunny.basic.reject.manual-acks", exclusive: true)
+      q  = ch.queue("bunny.basic.reject.reject.manual-acks", exclusive: true)
       x  = ch.default_exchange
 
       x.publish("bunneth", routing_key: q.name)
@@ -33,7 +33,7 @@
   context "with requeue = false" do
     it "rejects a message" do
       ch = connection.create_channel
-      q  = ch.queue("bunny.basic.reject.with-requeue-false", exclusive: true)
+      q  = ch.queue("bunny.basic.reject.reject.with-requeue-false", exclusive: true)
       x  = ch.default_exchange
 
       x.publish("bunneth", routing_key: q.name)
@@ -43,11 +43,8 @@
 
       ch.reject(delivery_info.delivery_tag, false)
       sleep(0.5)
-      ch.close
-
-      ch = connection.create_channel
-      q  = ch.queue("bunny.basic.reject.with-requeue-false", exclusive: true)
       expect(q.message_count).to eq 0
+
       ch.close
     end
   end
@@ -56,7 +53,7 @@
   context "with an invalid (random) delivery tag" do
     it "causes a channel-level error" do
       ch = connection.create_channel
-      q  = ch.queue("bunny.basic.reject.unknown-delivery-tag", exclusive: true)
+      q  = ch.queue("bunny.basic.reject.reject.unknown-delivery-tag", exclusive: true)
       x  = ch.default_exchange
 
       x.publish("bunneth", routing_key: q.name)
@@ -90,7 +87,7 @@
   context "with requeue = true" do
     it "requeues a message" do
       ch = connection.create_channel
-      q  = ch.queue("bunny.basic.reject.manual-acks", exclusive: true)
+      q  = ch.queue("bunny.basic.reject.basic_reject.manual-acks", exclusive: true)
       x  = ch.default_exchange
 
       x.publish("bunneth", routing_key: q.name)
@@ -109,7 +106,7 @@
   context "with requeue = false" do
     it "rejects a message" do
       ch = connection.create_channel
-      q  = ch.queue("bunny.basic.reject.with-requeue-false", exclusive: true)
+      q  = ch.queue("bunny.basic.reject.basic_reject.with-requeue-false", exclusive: true)
       x  = ch.default_exchange
 
       x.publish("bunneth", routing_key: q.name)
@@ -119,11 +116,8 @@
 
       ch.basic_reject(delivery_info.delivery_tag.to_i, false)
       sleep(0.5)
-      ch.close
-
-      ch = connection.create_channel
-      q  = ch.queue("bunny.basic.reject.with-requeue-false", exclusive: true)
       expect(q.message_count).to eq 0
+
       ch.close
     end
   end
@@ -131,7 +125,7 @@
   context "with requeue = default" do
     it "rejects a message" do
       ch = connection.create_channel
-      q  = ch.queue("bunny.basic.reject.with-requeue-false", exclusive: true)
+      q  = ch.queue("bunny.basic.reject.basic_reject.with-requeue-default", exclusive: true)
       x  = ch.default_exchange
 
       x.publish("bunneth", routing_key: q.name)
@@ -141,11 +135,8 @@
 
       ch.basic_reject(delivery_info.delivery_tag.to_i)
       sleep(0.5)
-      ch.close
-
-      ch = connection.create_channel
-      q  = ch.queue("bunny.basic.reject.with-requeue-false", exclusive: true)
       expect(q.message_count).to eq 0
+
       ch.close
     end
   end
