0
@@ -118,17 +118,15 @@ class Admin::UsersControllerTest < Test::Unit::TestCase
0
assert_equal 4, assigns(:users).size
0
- user_tag = { :tag => 'li', :attributes => { :id => 'user-1', :class => 'clear' } }
0
- normal_tag = { :tag => 'li', :attributes => { :id => 'user-2', :class => 'clear' } }
0
- deleted_tag = { :tag => 'li', :attributes => { :id => 'user-3', :class => 'clear deleted' } }
0
- assert_tag deleted_tag
0
- assert_no_tag 'input', :attributes => { :type => 'checkbox', :id => 'user-toggle-1' }, :ancestor => user_tag
0
- assert_tag 'input', :attributes => { :type => 'checkbox', :id => 'user-toggle-2' }, :ancestor => normal_tag
0
- assert_tag 'input', :attributes => { :type => 'checkbox', :id => 'user-toggle-3' }, :ancestor => deleted_tag
0
- assert_tag 'input', :attributes => { :type => 'checkbox', :id => 'user-toggle-2', :checked => 'checked' }, :ancestor => normal_tag
0
- assert_no_tag 'input', :attributes => { :type => 'checkbox', :id => 'user-toggle-3', :checked => 'checked' }, :ancestor => deleted_tag
0
+ assert_select "#users li[id='user-1']" do
0
+ assert_select "[class='clear']"
0
+ assert_select "#users li[id='user-2']" do
0
+ assert_select "[class='clear']"
0
+ assert_select "#disabled_users li[id='user-3']" do
0
+ assert_select "[class='clear deleted']"
0
def test_should_not_disable_as_site_member
0
@@ -139,6 +137,21 @@ class Admin::UsersControllerTest < Test::Unit::TestCase
0
+ def test_should_disable_site_admin
0
+ xhr :post, :admin, :id => users(:arthur).id
0
+ assert_response :success
0
+ assert !sites(:first).user(users(:arthur).id).site_admin?
0
+ def test_should_enable_site_admin
0
+ sites(:first).user_with_deleted(3).update_attribute :deleted_at, nil
0
+ xhr :post, :admin, :id => users(:aaron).id
0
+ assert_response :success
0
+ assert sites(:first).user(users(:aaron).id).site_admin?
0
def test_should_disable_user
0
assert_no_difference User, :count_with_deleted do
Comments
No one has commented yet.