If you are testing the CustomerFactory class, then you should not do it at all. Think about it as testing the interface of our unit, which is a CustomerFactory instance. You have the method called customersByCategory: and you are only interested in getting the NSArray of your customers object from this call. The fact that you use the DatabaseQueue and FMDatabase instances inside is the implementation detail which should be transparent to this specific unit test.
Testing the DatabaseQueue class is a different story, but it looks like the easiest way to achieve what you want is to use a real instance of the DatabaseQueue in your test.