You can use Doorkeeper models in your application test suite. Note that starting from Doorkeeper 4.3.0 it uses ActiveSupport lazy loading hooks to load models. There are known issue with the
factory_bot_railsgem (it executes factories building before
ActiveRecord::Baseis initialized using hooks in gem railtie, so you can catch a
uninitialized constanterror). It is recommended to use pure
factory_botgem to solve this problem.