Refactor image_reference tests with proper stubbing
Closes #4718 (closed)
I refactored the tests, with the assumption: If CI_PIPELINE_TRIGGERED is "true", CI_PIPELINE_SOURCE will be "triggered"
. Also properly stubbed dependent methods, which are individually tested in other places.
Edited by GitLab Release Tools Bot