summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-04 17:52:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-04 17:52:07 +0000
commitadee6de1404f4ae8243a9373412dc06965fc5cb7 (patch)
tree2aa2b0dba40741e4a0f5f86472117298c8894a78 /test
parent4ed89dc2d372ed34d2154f81f71b2a4632b3915e (diff)
downloadredmine-adee6de1404f4ae8243a9373412dc06965fc5cb7.tar.gz
redmine-adee6de1404f4ae8243a9373412dc06965fc5cb7.zip
Added a unit test on User#role_for_project
git-svn-id: http://redmine.rubyforge.org/svn/trunk@417 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/user_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index 10aafa58a..66cd72472 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -18,11 +18,12 @@
require File.dirname(__FILE__) + '/../test_helper'
class UserTest < Test::Unit::TestCase
- fixtures :users
+ fixtures :users, :members, :projects
def setup
@admin = User.find(1)
@jsmith = User.find(2)
+ @dlopper = User.find(3)
end
def test_truth
@@ -98,4 +99,14 @@ class UserTest < Test::Unit::TestCase
@jsmith.reload
assert_equal key.value, @jsmith.rss_key.value
end
+
+ def test_role_for_project
+ # user with a role
+ role = @jsmith.role_for_project(Project.find(1))
+ assert_kind_of Role, role
+ assert_equal "Manager", role.name
+
+ # user with no role
+ assert_nil @dlopper.role_for_project(Project.find(2))
+ end
end