get user_blocks_path
assert_response :success
- assert_select "table#block_list", :count => 1 do
- assert_select "tr", :count => 21
+ assert_select "table#block_list tbody", :count => 1 do
+ assert_select "tr", :count => 20
end
get user_blocks_path(:page => 2)
assert_response :success
- assert_select "table#block_list", :count => 1 do
- assert_select "tr", :count => 21
+ assert_select "table#block_list tbody", :count => 1 do
+ assert_select "tr", :count => 20
end
end
# Check that normal users can't load the block creation page
get new_user_block_path(:display_name => target_user.display_name)
- assert_response :redirect
assert_redirected_to :controller => "errors", :action => "forbidden"
# Login as a moderator
# Check that normal users can't load the block edit page
get edit_user_block_path(:id => active_block)
- assert_response :redirect
assert_redirected_to :controller => "errors", :action => "forbidden"
# Login as a moderator
# Check that normal users can't create blocks
post user_blocks_path
- assert_response :redirect
assert_redirected_to :controller => "errors", :action => "forbidden"
# Login as a moderator
# Check that normal users can't update blocks
put user_block_path(:id => active_block)
- assert_response :redirect
assert_redirected_to :controller => "errors", :action => "forbidden"
# Login as the wrong moderator
# Check that normal users can't load the block revoke page
get revoke_user_block_path(:id => active_block)
- assert_response :redirect
assert_redirected_to :controller => "errors", :action => "forbidden"
# Login as a moderator
# Check that normal users can't load the revoke all blocks page
get revoke_all_user_blocks_path(blocked_user)
- assert_response :redirect
assert_redirected_to :controller => "errors", :action => "forbidden"
# Login as a moderator
# Check that normal users can't load the block revoke page
get revoke_all_user_blocks_path(:blocked_user)
- assert_response :redirect
assert_redirected_to :controller => "errors", :action => "forbidden"
# Login as a moderator
get user_blocks_on_path(:display_name => user.display_name)
assert_response :success
- assert_select "table#block_list", :count => 1 do
- assert_select "tr", :count => 21
+ assert_select "table#block_list tbody", :count => 1 do
+ assert_select "tr", :count => 20
end
get user_blocks_on_path(:display_name => user.display_name, :page => 2)
assert_response :success
- assert_select "table#block_list", :count => 1 do
- assert_select "tr", :count => 21
+ assert_select "table#block_list tbody", :count => 1 do
+ assert_select "tr", :count => 20
end
end
get user_blocks_by_path(:display_name => user.display_name)
assert_response :success
- assert_select "table#block_list", :count => 1 do
- assert_select "tr", :count => 21
+ assert_select "table#block_list tbody", :count => 1 do
+ assert_select "tr", :count => 20
end
get user_blocks_by_path(:display_name => user.display_name, :page => 2)
assert_response :success
- assert_select "table#block_list", :count => 1 do
- assert_select "tr", :count => 21
+ assert_select "table#block_list tbody", :count => 1 do
+ assert_select "tr", :count => 20
end
end
end