##// END OF EJS Templates
Fixed that activities option tags on the time entry bulk edit form are escaped....
Fixed that activities option tags on the time entry bulk edit form are escaped. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9643 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r9453:ba5a052c8ca8
r9460:ee8dcab9db0a
Show More
role_test.rb
111 lines | 3.2 KiB | text/x-ruby | RubyLexer
Jean-Philippe Lang
Localize anonymous and non member roles names (#8072)....
r5213 # Redmine - project management software
Jean-Philippe Lang
Copyright update....
r9453 # Copyright (C) 2006-2012 Jean-Philippe Lang
Jean-Philippe Lang
Workflow copy:...
r1237 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Toshi MARUYAMA
remove trailing white-spaces from test/unit/role_test.rb....
r6649 #
Jean-Philippe Lang
Workflow copy:...
r1237 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Toshi MARUYAMA
remove trailing white-spaces from test/unit/role_test.rb....
r6649 #
Jean-Philippe Lang
Workflow copy:...
r1237 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../test_helper', __FILE__)
Jean-Philippe Lang
Workflow copy:...
r1237
Eric Davis
Upgraded to Rails 2.3.4 (#3597)...
r2773 class RoleTest < ActiveSupport::TestCase
Jean-Philippe Lang
Workflow copy:...
r1237 fixtures :roles, :workflows
def test_copy_workflows
source = Role.find(1)
assert_equal 90, source.workflows.size
Toshi MARUYAMA
remove trailing white-spaces from test/unit/role_test.rb....
r6649
Jean-Philippe Lang
Workflow copy:...
r1237 target = Role.new(:name => 'Target')
assert target.save
Jean-Philippe Lang
Merged Rails 2.1 compatibility branch....
r1609 target.workflows.copy(source)
Jean-Philippe Lang
Workflow copy:...
r1237 target.reload
assert_equal 90, target.workflows.size
end
Jean-Philippe Lang
Merged nbc branch @ r1812 (commit access permission and reposman improvements)....
r1812
def test_add_permission
role = Role.find(1)
size = role.permissions.size
role.add_permission!("apermission", "anotherpermission")
role.reload
assert role.permissions.include?(:anotherpermission)
assert_equal size + 2, role.permissions.size
end
def test_remove_permission
role = Role.find(1)
size = role.permissions.size
perm = role.permissions[0..1]
role.remove_permission!(*perm)
role.reload
assert ! role.permissions.include?(perm[0])
assert_equal size - 2, role.permissions.size
end
Toshi MARUYAMA
remove trailing white-spaces from test/unit/role_test.rb....
r6649
Jean-Philippe Lang
Localize anonymous and non member roles names (#8072)....
r5213 def test_name
I18n.locale = 'fr'
assert_equal 'Manager', Role.find(1).name
assert_equal 'Anonyme', Role.anonymous.name
assert_equal 'Non membre', Role.non_member.name
end
Jean-Philippe Lang
Merged nbc branch @ r1812 (commit access permission and reposman improvements)....
r1812
Eric Davis
Change Role#anonymous and #non_member so they generate the record as needed....
r3249 context "#anonymous" do
should "return the anonymous role" do
role = Role.anonymous
assert role.builtin?
assert_equal Role::BUILTIN_ANONYMOUS, role.builtin
end
context "with a missing anonymous role" do
setup do
Role.delete_all("builtin = #{Role::BUILTIN_ANONYMOUS}")
end
should "create a new anonymous role" do
assert_difference('Role.count') do
Role.anonymous
end
end
should "return the anonymous role" do
role = Role.anonymous
assert role.builtin?
assert_equal Role::BUILTIN_ANONYMOUS, role.builtin
end
end
end
context "#non_member" do
should "return the non-member role" do
role = Role.non_member
assert role.builtin?
assert_equal Role::BUILTIN_NON_MEMBER, role.builtin
end
context "with a missing non-member role" do
setup do
Role.delete_all("builtin = #{Role::BUILTIN_NON_MEMBER}")
end
should "create a new non-member role" do
assert_difference('Role.count') do
Role.non_member
end
end
should "return the non-member role" do
role = Role.non_member
assert role.builtin?
assert_equal Role::BUILTIN_NON_MEMBER, role.builtin
end
end
end
Jean-Philippe Lang
Workflow copy:...
r1237 end