test/test_server.rb in ruby-openid-2.1.2 vs test/test_server.rb in ruby-openid-2.1.4
- old
+ new
@@ -1419,18 +1419,22 @@
# Look for user_setup_url in checkid_immediate negative response
# in OpenID 1 case.
@request.message = Message.new(OPENID1_NS)
@request.mode = 'checkid_immediate'
@request.immediate = true
+ @request.claimed_id = 'http://claimed-id.test/'
server_url = "http://setup-url.unittest/"
# crappiting setup_url, you dirty my interface with your presence!
answer = @request.answer(false, server_url)
assert_equal(answer.request, @request)
assert_equal(2, answer.fields.to_post_args.length, answer.fields)
assert_equal(OPENID1_NS, answer.fields.get_openid_namespace)
assert_equal('id_res', answer.fields.get_arg(OPENID_NS, 'mode'))
- assert(answer.fields.get_arg(
- OPENID_NS, 'user_setup_url', '').starts_with?(server_url))
+
+ usu = answer.fields.get_arg(OPENID_NS, 'user_setup_url', '')
+ assert(usu.starts_with?(server_url))
+ expected_substr = 'openid.claimed_id=http%3A%2F%2Fclaimed-id.test%2F'
+ assert(!usu.index(expected_substr).nil?, usu)
end
def test_answerSetupDeny
answer = @request.answer(false)
assert_equal(answer.fields.get_args(OPENID_NS), {