From 6879a995a434ab037c3d282f6f5199f41480f2ee Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Mon, 16 Jun 2008 16:26:11 +0000 Subject: [PATCH] ActionItem392: fixed the test_helper to not use 'root' to identify the admin and account_controller_test to expect a name call instead of a identifier --- test/functional/account_controller_test.rb | 2 +- test/test_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index 0c9a441..d9f910f 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -208,7 +208,7 @@ class AccountControllerTest < Test::Unit::TestCase change = ChangePassword.new ChangePassword.expects(:find_by_code).with('osidufgiashfkjsadfhkj99999').returns(change) person = mock - person.stubs(:identifier).returns('joe') + person.stubs(:name).returns('joe') change.stubs(:requestor).returns(person) get :new_password, :code => 'osidufgiashfkjsadfhkj99999' diff --git a/test/test_helper.rb b/test/test_helper.rb index f1b4e0d..4455efa 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -63,7 +63,7 @@ class Test::Unit::TestCase end def create_admin_user(env) - admin_user = User.find_by_login('root') || User.create!(:login => 'root', :email => 'root@noosfero.org', :password => 'root', :password_confirmation => 'root') + admin_user = User.find_by_login('root_user') || User.create!(:login => 'root_user', :email => 'root@noosfero.org', :password => 'root', :password_confirmation => 'root') admin_role = Role.find_by_name('admin_role') || Role.create!(:name => 'admin_role', :permissions => ['view_environment_admin_panel','edit_environment_features', 'edit_environment_design', 'manage_environment_categories', 'manage_environment_roles', 'manage_environment_validators']) RoleAssignment.create!(:accessor => admin_user.person, :role => admin_role, :resource => env) unless admin_user.person.role_assignments.map{|ra|[ra.role, ra.accessor, ra.resource]}.include?([admin_role, admin_user, env]) admin_user.login -- libgit2 0.21.2