1 require File.dirname(__FILE__) + '/../test_helper'
6 class GroupTest < Test::Unit::TestCase
7 fixtures :groups, :users, :settings
10 assert_equal groups(:g100).members.length, 2
11 assert_equal groups(:g101).members.length, 0
21 assert g.save == false
23 assert g.save == false
25 assert g.save == false
32 g.g_user_title = 'a'*50
34 g.g_user_title = 'a'*51
35 assert g.save == false
41 Settings.group_ids = {:pun_admin => 1}
42 assert_equal true, g.is_admin?
43 Settings.group_ids = {:pun_admin => 2}
44 assert_equal false, g.is_admin?
50 Settings.group_ids = {:pun_mod => 1}
51 assert g.is_mod? == true
52 Settings.group_ids = {:pun_mod => 2}
53 assert g.is_mod? == false
59 Settings.group_ids = {:pun_guest => 1}
60 assert g.is_guest? == true
61 Settings.group_ids = {:pun_guest => 2}
62 assert g.is_guest? == false