diff --git a/lib/registration.rb b/lib/registration.rb index 892dbcab2135849514f2909259eb2578e3088d6e..4ee8a8a16ac6c52762252311f0fe10bbcf12e1f4 100644 --- a/lib/registration.rb +++ b/lib/registration.rb @@ -255,11 +255,13 @@ class Registration def write Command.reply { |reply| - reply.allowed_actions = [:next] + reply.allowed_actions = [:next, :prev] toob = oob(reply) reply.note_type = :info reply.note_text = "#{toob.desc}: #{toob.url}" - }.then do + }.then do |iq| + next Activation.for(@customer, @tel).then(&:write) if iq.prev? + CreditCard.for(@customer, @tel, finish: @finish).then(&:write) end end diff --git a/test/test_registration.rb b/test/test_registration.rb index e970451820f8031f381faf385b425ed59ea7b440..f0f6230b01d523613626ba3813622ad7c70af755 100644 --- a/test/test_registration.rb +++ b/test/test_registration.rb @@ -391,7 +391,7 @@ class RegistrationTest < Minitest::Test :write, EMPromise.reject(:test_result), [Matching.new do |reply| - assert_equal [:execute, :next], reply.allowed_actions + assert_equal [:execute, :next, :prev], reply.allowed_actions assert_equal( "Add credit card, then return here to continue: " \ "http://creditcard.example.com",