Allow prev from credit card form

Stephen Paul Weber created

Change summary

lib/registration.rb       | 6 ++++--
test/test_registration.rb | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)

Detailed changes

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

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",