Commit 6879a995a434ab037c3d282f6f5199f41480f2ee
1 parent
e878dae3
Exists in
master
and in
23 other branches
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 git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2032 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
test/functional/account_controller_test.rb
| ... | ... | @@ -208,7 +208,7 @@ class AccountControllerTest < Test::Unit::TestCase |
| 208 | 208 | change = ChangePassword.new |
| 209 | 209 | ChangePassword.expects(:find_by_code).with('osidufgiashfkjsadfhkj99999').returns(change) |
| 210 | 210 | person = mock |
| 211 | - person.stubs(:identifier).returns('joe') | |
| 211 | + person.stubs(:name).returns('joe') | |
| 212 | 212 | change.stubs(:requestor).returns(person) |
| 213 | 213 | |
| 214 | 214 | get :new_password, :code => 'osidufgiashfkjsadfhkj99999' | ... | ... |
test/test_helper.rb
| ... | ... | @@ -63,7 +63,7 @@ class Test::Unit::TestCase |
| 63 | 63 | end |
| 64 | 64 | |
| 65 | 65 | def create_admin_user(env) |
| 66 | - admin_user = User.find_by_login('root') || User.create!(:login => 'root', :email => 'root@noosfero.org', :password => 'root', :password_confirmation => 'root') | |
| 66 | + admin_user = User.find_by_login('root_user') || User.create!(:login => 'root_user', :email => 'root@noosfero.org', :password => 'root', :password_confirmation => 'root') | |
| 67 | 67 | 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']) |
| 68 | 68 | 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]) |
| 69 | 69 | admin_user.login | ... | ... |