diff --git a/lib/openid/consumer/responses.rb b/lib/openid/consumer/responses.rb index 4947c1ca..89a551fb 100644 --- a/lib/openid/consumer/responses.rb +++ b/lib/openid/consumer/responses.rb @@ -139,6 +139,8 @@ def initialize(endpoint) class SetupNeededResponse include Response STATUS = SETUP_NEEDED + + attr_reader :setup_url def initialize(endpoint, setup_url) @endpoint = endpoint @setup_url = setup_url diff --git a/test/test_accept.rb b/test/test_accept.rb index 06db85bf..f4096009 100644 --- a/test/test_accept.rb +++ b/test/test_accept.rb @@ -3,6 +3,7 @@ require 'openid/yadis/accept' require 'openid/extras' require 'openid/util' +require 'testutil' module OpenID diff --git a/test/test_association.rb b/test/test_association.rb index 1b273321..35c28560 100644 --- a/test/test_association.rb +++ b/test/test_association.rb @@ -1,5 +1,6 @@ require "test/unit" require "openid/association" +require 'testutil' module OpenID class AssociationTestCase < Test::Unit::TestCase diff --git a/test/test_associationmanager.rb b/test/test_associationmanager.rb index 041449ff..2f981c5a 100644 --- a/test/test_associationmanager.rb +++ b/test/test_associationmanager.rb @@ -8,6 +8,7 @@ require "test/unit" require "util" require "time" +require 'testutil' module OpenID class DHAssocSessionTest < Test::Unit::TestCase diff --git a/test/test_consumer.rb b/test/test_consumer.rb index dc4a09e6..da485f4d 100644 --- a/test/test_consumer.rb +++ b/test/test_consumer.rb @@ -182,9 +182,11 @@ def test_setup_needed_openid1 end def test_setup_needed_openid2 - args = {'openid.ns' => OPENID2_NS, 'openid.mode' => 'setup_needed'} + setup_url = 'http://setup.url/' + args = {'openid.ns' => OPENID2_NS, 'openid.mode' => 'setup_needed', 'openid.user_setup_url' => setup_url} response = @consumer.complete(args, nil) assert_equal(SETUP_NEEDED, response.status) + assert_equal(setup_url, response.setup_url) end def test_idres_setup_needed_openid1 @@ -195,6 +197,7 @@ def test_idres_setup_needed_openid1 } response = @consumer.complete(args, nil) assert_equal(SETUP_NEEDED, response.status) + assert_equal(setup_url, response.setup_url) end def test_error