From d1649c17e4bf80a9042382186c587a3953f956a8 Mon Sep 17 00:00:00 2001 From: Phillip Davis Date: Tue, 3 Mar 2026 16:08:11 -0500 Subject: [PATCH] test(port-out-pin): complete success sets pin --- test/property/test_port_out_pin.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/property/test_port_out_pin.rb b/test/property/test_port_out_pin.rb index 82e77609b77e43e6d5d95d5b99befbbab4faecf6..ea0a4efa4c1752b7a24bcc7f29d808c14c6e41e2 100644 --- a/test/property/test_port_out_pin.rb +++ b/test/property/test_port_out_pin.rb @@ -52,4 +52,29 @@ class PortOutPinPropertyTest < Minitest::Test } end em :test_execute_rejects_unregistered_user + + def test_complete_success_sets_pin + property_of { + PortOutPinCompleteCmd.new(REDIS).generate + }.check { |_metadata, example| + BandwidthTNOptions.stub( + :set_port_out_pin, + EMPromise.resolve(nil) + ) do + process_stanza(example['stanza']) + end + + assert_equal 1, written.length + reply = written.shift + + assert_equal example['jid'], reply.to.to_s + assert_equal :completed, reply.status + assert_equal 'set-port-out-pin', reply.node + ns = 'http://jabber.org/protocol/commands' + note = reply.find('.//ns:note', ns: ns).first + assert_equal 'info', note[:type] + assert_equal 'Port-out PIN has been set successfully.', note.content + } + end + em :test_complete_success_sets_pin end