Enable :profile_admin feature flag (#17187)

This makes profile fields available for all forems.

There is a follow up task to remove the conditionals around this (and
remove the flag).
This commit is contained in:
Daniel Uber 2022-04-08 14:03:55 -05:00 committed by GitHub
parent 0382b86755
commit c8149e8e1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,7 @@
module DataUpdateScripts
class EnableProfileAdminFeature
def run
FeatureFlag.enable(:profile_admin)
end
end
end

View file

@ -0,0 +1,32 @@
require "rails_helper"
require Rails.root.join(
"lib/data_update_scripts/20220408154416_enable_profile_admin_feature.rb",
)
describe DataUpdateScripts::EnableProfileAdminFeature do
after do
FeatureFlag.remove(:profile_admin)
end
it "enables the :profile_admin flag" do
expect do
described_class.new.run
end.to change { FeatureFlag.enabled?(:profile_admin) }.from(false).to(true)
end
it "works if the flag is already available" do
FeatureFlag.add(:profile_admin)
expect do
described_class.new.run
end.not_to change { FeatureFlag.exist?(:profile_admin) }
end
it "works if the flag is already enabled" do
FeatureFlag.enable(:profile_admin)
expect do
described_class.new.run
end.not_to change { FeatureFlag.enabled?(:profile_admin) }
end
end