~singpolyma/sgx-jmp

51121d1b2178560352f7a8a427a1a607da439968 — Stephen Paul Weber 1 year, 2 months ago d40dfe0 + 6100ac7
Merge branch 'wording'

* wording:
  Update instructions to be closer to what is in current web signup
2 files changed, 27 insertions(+), 3 deletions(-)

M lib/registration.rb
M test/test_registration.rb
M lib/registration.rb => lib/registration.rb +26 -2
@@ 67,7 67,7 @@ class Registration
					},
					{
						value: "credit_card",
						label: "Credit Card ($#{CONFIG[:activation_amount]})"
						label: "Credit Card"
					},
					{
						value: "code",


@@ 93,12 93,36 @@ class Registration
			}
		].freeze

		ACTIVATE_INSTRUCTION =
			"To activate your account, you can either deposit " \
			"$#{CONFIG[:activation_amount]} to your balance or enter " \
			"your invite code if you have one."

		CRYPTOCURRENCY_INSTRUCTION =
			"(If you'd like to pay in a cryptocurrency other than " \
			"Bitcoin, currently we recommend using a service like " \
			"simpleswap.io, morphtoken.com, changenow.io, or godex.io. " \
			"Manual payment via Bitcoin Cash is also available if you " \
			"contact support.)"

		def add_instructions(form, center)
			[
				"You've selected #{tel} (#{center}) as your JMP number",
				ACTIVATE_INSTRUCTION,
				CRYPTOCURRENCY_INSTRUCTION
			].each do |txt|
				form << Blather::XMPPNode.new(:instructions, form.document).tap do |i|
					i << txt
				end
			end
		end

		def write
			rate_center.then do |center|
				form = reply.form
				form.type = :form
				form.title = "Activate JMP"
				form.instructions = "Going to activate #{tel} (#{center})"
				add_instructions(form, center)
				form.fields = FORM_FIELDS

				COMMAND_MANAGER.write(reply).then { |iq|

M test/test_registration.rb => test/test_registration.rb +1 -1
@@ 90,7 90,7 @@ class RegistrationTest < Minitest::Test
				[Matching.new do |iq|
					assert_equal :form, iq.form.type
					assert_equal(
						"Going to activate +15555550000 (FA, KE)",
						"You've selected +15555550000 (FA, KE) as your JMP number",
						iq.form.instructions
					)
				end]