There's nothing wrong with your stub code or the code you're trying to test, as evidenced by the following passing test:
require 'spec_helper'
class User ; end
describe "" do
it "" do
User.stub_chain(:something).and_return(nil)
expect { raise NameError if User.something.blank? }.to raise_error(NameError)
end
end
You must have some problem elsewhere in your code.