diff --git a/ee/lib/api/code_suggestions.rb b/ee/lib/api/code_suggestions.rb index 3c21e90f4f7ed227cdef42c6a4297464617466d0..e375a7b94ac98476b01b27ada0e1952b9448f82e 100644 --- a/ee/lib/api/code_suggestions.rb +++ b/ee/lib/api/code_suggestions.rb @@ -23,8 +23,8 @@ def user_allowed? end def active_code_suggestions_purchase?(project_id) - return false unless project_id return true unless ::Feature.enabled?(:purchase_code_suggestions) + return false unless project_id cache_key = format(PROJECT_CODE_SUGGESTIONS_ADD_ON_CACHE_KEY, project_id: project_id) Rails.cache.fetch(cache_key, expires_in: 1.hour) do diff --git a/ee/spec/requests/api/code_suggestions_spec.rb b/ee/spec/requests/api/code_suggestions_spec.rb index 27d14fc833137018d45e8cbf561332efba7552e5..e6ea4735f10f3394c5a5526106af0f78898fdce5 100644 --- a/ee/spec/requests/api/code_suggestions_spec.rb +++ b/ee/spec/requests/api/code_suggestions_spec.rb @@ -333,7 +333,7 @@ stub_feature_flags(purchase_code_suggestions: false) end - include_examples 'a not found response' + it_behaves_like 'code completions endpoint' end end