~singpolyma/sgx-jmp

ref: 9c5695ebc97b0c94571f094bcdc3d48bbba20232 sgx-jmp/test/test_web_register_manager.rb -rw-r--r-- 853 bytes
9c5695ebStephen Paul Weber Merge branch 'register-command-first-pass' 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

require "test_helper"
require "web_register_manager"

class WebRegisterManagerTest < Minitest::Test
	def setup
		@manager = WebRegisterManager.new
	end

	def test_set_get
		assert_kind_of WebRegisterManager::ChooseTel, @manager["jid@example.com"]
		@manager["jid@example.com"] = "+15555550000"
		assert_kind_of WebRegisterManager::HaveTel, @manager["jid@example.com"]
	end

	def test_choose_tel_have_tel
		@manager["jid@example.com"] = "+15555550000"
		iq = Blather::Stanza::Iq.new
		iq.from = "jid@example.com"
		assert_equal [iq, "+15555550000"], @manager.choose_tel(iq).sync
	end
	em :test_choose_tel_have_tel

	def test_choose_tel_not_have_tel
		skip "ChooseTel not implemented yet"
		iq = Blather::Stanza::Iq.new
		iq.from = "jid@example.com"
		@manager.choose_tel(iq).sync
	end
	em :test_choose_tel_not_have_tel
end