Commit 220e1fdb authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'eliminate-analytics-feature-flag' into 'master'

Eliminate analytics feature flag

See merge request gitlab-org/gitlab!16663
parents b8f0f1b1 bf233fa2
Pipeline #82447916 passed with stages
in 42 minutes and 11 seconds
......@@ -117,7 +117,7 @@ Rails.application.routes.draw do
end
Gitlab.ee do
constraints(::Constraints::FeatureConstrainer.new(:analytics)) do
constraints(-> (*) { Gitlab::Analytics.any_features_enabled? }) do
draw :analytics
end
end
......
---
title: Eliminate analytics feature flag requirement for /analytics routes
merge_request: 16663
author:
type: fixed
......@@ -3,11 +3,11 @@
namespace :analytics do
root to: 'analytics#index'
constraints(::Constraints::FeatureConstrainer.new(:productivity_analytics)) do
constraints(::Constraints::FeatureConstrainer.new(Gitlab::Analytics::PRODUCTIVITY_ANALYTICS_FEATURE_FLAG)) do
resource :productivity_analytics, only: :show
end
constraints(::Constraints::FeatureConstrainer.new(:cycle_analytics)) do
constraints(::Constraints::FeatureConstrainer.new(Gitlab::Analytics::CYCLE_ANALYTICS_FEATURE_FLAG)) do
resource :cycle_analytics, only: :show
end
end
# frozen_string_literal: true
require 'spec_helper'
describe 'accessing the analytics workspace' do
include AnalyticsHelpers
let(:user) { create(:user) }
before do
sign_in(user)
end
it 'renders 404 if analytics features are turned off' do
disable_all_analytics_feature_flags
visit analytics_root_path
expect(page.status_code).to eq(404)
end
it 'renders the productivity analytics landing page' do
stub_licensed_features(Gitlab::Analytics::PRODUCTIVITY_ANALYTICS_FEATURE_FLAG => true)
visit analytics_root_path
expect(page.status_code).to eq(200)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment