diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/account_test.rb | 4 | ||||
-rw-r--r-- | test/unit/auth_source_ldap_test.rb | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/test/integration/account_test.rb b/test/integration/account_test.rb index f82e681b1..8307702e0 100644 --- a/test/integration/account_test.rb +++ b/test/integration/account_test.rb @@ -149,7 +149,7 @@ class AccountTest < ActionController::IntegrationTest def test_onthefly_registration # disable registration Setting.self_registration = '0' - AuthSource.expects(:authenticate).returns([:login => 'foo', :firstname => 'Foo', :lastname => 'Smith', :mail => 'foo@bar.com', :auth_source_id => 66]) + AuthSource.expects(:authenticate).returns({:login => 'foo', :firstname => 'Foo', :lastname => 'Smith', :mail => 'foo@bar.com', :auth_source_id => 66}) post 'account/login', :username => 'foo', :password => 'bar' assert_redirected_to 'my/page' @@ -163,7 +163,7 @@ class AccountTest < ActionController::IntegrationTest def test_onthefly_registration_with_invalid_attributes # disable registration Setting.self_registration = '0' - AuthSource.expects(:authenticate).returns([:login => 'foo', :lastname => 'Smith', :auth_source_id => 66]) + AuthSource.expects(:authenticate).returns({:login => 'foo', :lastname => 'Smith', :auth_source_id => 66}) post 'account/login', :username => 'foo', :password => 'bar' assert_response :success diff --git a/test/unit/auth_source_ldap_test.rb b/test/unit/auth_source_ldap_test.rb index f78d6452f..885272c11 100644 --- a/test/unit/auth_source_ldap_test.rb +++ b/test/unit/auth_source_ldap_test.rb @@ -43,10 +43,8 @@ class AuthSourceLdapTest < ActiveSupport::TestCase context 'with a valid LDAP user' do should 'return the user attributes' do - response = @auth.authenticate('example1','123456') - assert response.is_a?(Array), "An array was not returned" - assert response.first.present?, "No user data returned" - attributes = response.first + attributes = @auth.authenticate('example1','123456') + assert attributes.is_a?(Hash), "An hash was not returned" assert_equal 'Example', attributes[:firstname] assert_equal 'One', attributes[:lastname] assert_equal 'example1@redmine.org', attributes[:mail] |