Skip to content

Avoid stubbing a Geo node instance

Igor Drozdov requested to merge id-avoid-stubbing-geo-node into master

What does this MR do?

Geo node can be created via let_it_be, i.e frozen. The frozen objects shouldn't be stubbed. Let's define GeoNode.current? method instead and stub its calls.

At first I had and idea of stubbing GeoNode.current_node_name to the passed node name, but we have the logic that doesn't allow secondary node to be current: https://gitlab.com/gitlab-org/gitlab/-/blob/b7af7cbaa4774c78d8dbc31df45971e48050446e/ee/app/models/geo_node.rb#L362. That's why it didn't work in tests.

Related issue: #328805 (closed)

Edited by Igor Drozdov

Merge request reports

Loading