From: Eric Davis Date: Thu, 19 Aug 2010 04:34:42 +0000 (+0000) Subject: Merged r3951 from trunk. X-Git-Tag: 1.0.1~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=047bf692b36943d61fa1cfd84b95f634ea5b3953;p=redmine.git Merged r3951 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4001 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/integration/layout_test.rb b/test/integration/layout_test.rb index 03d407d24..001bf50d2 100644 --- a/test/integration/layout_test.rb +++ b/test/integration/layout_test.rb @@ -13,9 +13,7 @@ class LayoutTest < ActionController::IntegrationTest end test "browsing to an unauthorized page should render the base layout" do - user = User.find(9) - user.password, user.password_confirmation = 'test', 'test' - user.save! + change_user_password('miscuser9', 'test') log_user('miscuser9','test') diff --git a/test/test_helper.rb b/test/test_helper.rb index 15a1f1570..dc04fa82d 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -86,6 +86,12 @@ class ActiveSupport::TestCase saved_settings.each {|k, v| Setting[k] = v} end + def change_user_password(login, new_password) + user = User.first(:conditions => {:login => login}) + user.password, user.password_confirmation = new_password, new_password + user.save! + end + def self.ldap_configured? @test_ldap = Net::LDAP.new(:host => '127.0.0.1', :port => 389) return @test_ldap.bind