Follow-up from "Fix tree_restorer spec"
The following discussions from !29141 (merged) should be addressed:
-
@mkaeppler started a discussion: (+10 comments) When we stub feature flags using the helper in
spec/support/helpers/stub_feature_flags.rb
, we're expecting certain arguments. If the code encounters another FF that's not stubbed, it would raise that "unexpected arguments" exception.To prevent that from happening, we have a default stub in https://gitlab.com/gitlab-org/gitlab/blob/bab1c8ec29e7fea30fa4f73271428b4f84cdb939/spec/spec_helper.rb#L169 that would catch this "any arguments" case. This is done before every test example in a
before
block.Now here in our
RSpec::Mocks.with_temporary_scope
, we don't have this fallback stub defined that's why that line was required.But maybe we should make it
allow(Feature).to receive(:enabled?) { true }
so that it is consistent with the behavior in our regular test examples scope. -
@engwan started a discussion: (+1 comment) @nmilojevic1 just curious why we have to stub this twice?