E2E: Update all resource attributes when calling reload!
Description of the test
Properly support resource object creation and attribute reloads to better support importer tests where most of the objects get created on the Gitlab side and all of the attribute values need to be fetched rather than set during fabrication.
By naming convention reload!
method should support that, yet it only updates the api
objects and accessing value via custom attribute will not fetch updated value if it was already populated.
This MR enhances reload!
behaviour and refactors Resource::Base
in following ways:
- Refactors
Base
class - separate instance methods from class methods withclass << self
- Removes
Dsl
subclass and simply create privateattribute
class method - Adds
attributes
method to create multiple attributes without a block - Updates custom attributes on
reload!
method call each time it is called - Adds
init
class method to create new instance of object without performing any api calls - Updates
MergeRequest
resource- Renames
id
toiid
to be inline with api response. - Adds
comments
method - Removes reference to
project.default_branch
insideinitialize
block which is always fabricating new project since it is always stillnil
whennew
is called
- Renames
- Adds MR comment validation to Github importer tests
- Update specs according to refactor
Edited by Andrejs Cunskis