is_active_sidebar('Test'); function works correctly if the correct slug is used.
I think that the problem is that you are constructing the sidebar ID like this:
$sidebarID = preg_replace("/[\s_]/", "-", strtolower($page->post_title));
sidebar- to it ...
'name' => $page->post_title,
'id' => 'sidebar-'.$sidebarID,
But you are using the unmodified title as the slug when you check ...
You need to alter your code that you are checking for the correct sidebar slug. you need to be consistent.
Edit: As stated, the "function works correctly if the correct slug is used". While the Codex does state that the "Name" is a valid parameter value, using the name does not work, at least not when I try to use it. Proof of concept (mostly copied from the Codex):
$args = array(
'name' => 'My Sidebar',
'id' => 'my-sidebar-id',
'description' => '',
'class' => '',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>'
With a sidebar registered with the above code, and a widget in the sidebar, the following returns
While using the ID returns the correct result--
I have not done enough research to determine whether the Codex is wrong, or whether there is a bug in the Core. However, using un-normalized data like a post name is probably a bad idea in either case.