##// END OF EJS Templates
Added a unit test on User#role_for_project...
Jean-Philippe Lang -
r414:adee6de1404f
parent child
Show More
@@ -18,11 +18,12
18 18 require File.dirname(__FILE__) + '/../test_helper'
19 19
20 20 class UserTest < Test::Unit::TestCase
21 fixtures :users
21 fixtures :users, :members, :projects
22 22
23 23 def setup
24 24 @admin = User.find(1)
25 25 @jsmith = User.find(2)
26 @dlopper = User.find(3)
26 27 end
27 28
28 29 def test_truth
@@ -98,4 +99,14 class UserTest < Test::Unit::TestCase
98 99 @jsmith.reload
99 100 assert_equal key.value, @jsmith.rss_key.value
100 101 end
102
103 def test_role_for_project
104 # user with a role
105 role = @jsmith.role_for_project(Project.find(1))
106 assert_kind_of Role, role
107 assert_equal "Manager", role.name
108
109 # user with no role
110 assert_nil @dlopper.role_for_project(Project.find(2))
111 end
101 112 end
General Comments 0
You need to be logged in to leave comments. Login now