M lib/registration.rb => lib/registration.rb +4 -2
@@ 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
M test/test_registration.rb => test/test_registration.rb +1 -1
@@ 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",