Rcov not detecting request.xhr? test

I have a method

def index
if request.xhr?
@users = User.find( :all )
end
end

And then I have a test for it:

def test_index
user = users( :foo )
xhr :post, :index, {}, { :user_id => user.user_id }
assert_response :success
assert_template ‘users/index’
end

The test works fine. If I put a puts in there it fires, so I know the
test is hitting the block in question.

So then when I run rcov, it produces a report that says the code block
has not yet been covered with a test.

I also tried xhr :get in my test but got the same result.

Anyone know anything about this? Is there a workaround, or another way?

Thanks,


Greg D.
http://destiney.com/