QA: Simply use the factory instance as the product
After https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22327 Factory::Product
will simply be a very thin wrapper around Factory::Base
, and there's no strong reason to keep using Factory::Product
. We should absorb it into Factory::Base
and rename it to Resource::Base
.
After we absorb Factory::Product
, we could also move Factory::Product#populate
to Resource::Base
and use it to construct the eagerly needed attributes instead of calling them individually.
e.g. in qa/qa/factory/resource/merge_request.rb
there's:
target
source
project.visit!
This could be updated to:
populate(:target, :source)
project.visit!
Which makes the intention much more clear.
The following discussion from !22327 (merged) should be addressed:
-
@godfat started a discussion: (+2 comments) I don't like
define_singleton_method
, and I will prefer to define the actual class. However given I already changed a lot of stuffs here, let's not touch it right now.