diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 11401b116d3eb74eb85e017e47e75ec829093b9a..a4d177da0bea6611e93fb59f4d2df44c83b78983 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -3378,7 +3378,7 @@ describe User do end it 'does not require consent if usage stats were set by this user' do - allow(Gitlab::CurrentSettings).to receive(:usage_stats_set_by_user_id).and_return(user.id) + create(:application_setting, usage_stats_set_by_user_id: user.id) expect(user.requires_usage_stats_consent?).to be false end