+
+ # Fetch the actual list
+ get :list, {:display_name => users(:public_user).display_name}, {:user => users(:public_user).id}
+ assert_response :success
+ assert_template "list"
+ check_trace_list users(:public_user).traces
+ end
+
+ # Check the list of changesets for a specific user
+ def test_list_user
+ # Test a user with no traces
+ get :list, :display_name => users(:second_public_user).display_name
+ assert_response :success
+ assert_template "list"
+ check_trace_list users(:second_public_user).traces.public
+
+ # Test a user with some traces - should see only public ones
+ get :list, :display_name => users(:public_user).display_name
+ assert_response :success
+ assert_template "list"
+ check_trace_list users(:public_user).traces.public
+
+ @request.cookies["_osm_username"] = users(:normal_user).display_name
+
+ # Should still see only public ones when authenticated as another user
+ get :list, {:display_name => users(:public_user).display_name}, {:user => users(:normal_user).id}
+ assert_response :success
+ assert_template "list"
+ check_trace_list users(:public_user).traces.public
+
+ @request.cookies["_osm_username"] = users(:public_user).display_name
+
+ # Should see all traces when authenticated as the target user
+ get :list, {:display_name => users(:public_user).display_name}, {:user => users(:public_user).id}
+ assert_response :success
+ assert_template "list"
+ check_trace_list users(:public_user).traces