spec/factories_spec.rb test doesn't test EE factories
During moving some EE test factories to CE, we discovered that spec/factories_spec.rb
started failing. It happened because some of those factories were for PORO classes and don't support save
method and in test we have expectation that factory can be created.
This finding leads to the suspicion that EE factories are simply not tested and that's why we didn't have this failure when those PORO factories were added to EE.
Further investigation (internal thread) lead to discovery that FactoryBot.factories.to_a.map(&:name)
does not returns EE factories.
Steps to reproduce
- Move
ee/spec/factories/dependencies.rb
to CE. - Run
rspec spec/factories_spec.rb
- Observe the error message
undefined method 'save!'
/cc @tkuah @theoretick