~singpolyma/sgx-jmp

f4ece3cbe3dcff69c10eab551ddad5d8608ea1a5 — Stephen Paul Weber 1 year, 8 months ago 56ce853
Test that registered users get the Registered step
1 files changed, 13 insertions(+), 0 deletions(-)

M test/test_registration.rb
M test/test_registration.rb => test/test_registration.rb +13 -0
@@ 4,6 4,19 @@ require "test_helper"
require "registration"

class RegistrationTest < Minitest::Test
	def test_for_registered
		BACKEND_SGX.expect(
			:registered?,
			EMPromise.resolve(OpenStruct.new(phone: "+15555550000")),
			["test"]
		)
		iq = Blather::Stanza::Iq::Command.new
		iq.from = "test@example.com"
		result = Registration.for(iq, Customer.new("test"), Minitest::Mock.new).sync
		assert_kind_of Registration::Registered, result
	end
	em :test_for_registered

	def test_for_activated
		BACKEND_SGX.expect(
			:registered?,