Launch creator Onboarding with the Feature Flag [ To merge only on January 17 ] (#16090)

* feat: add the DUS script

* feat: enable the Feature Flag
This commit is contained in:
Ridhwana 2022-01-17 16:46:38 +02:00 committed by GitHub
parent a8fa1c916a
commit f3cb4238d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,8 @@
module DataUpdateScripts
class EnableCreatorOnboardingFeatureFlag
def run
FeatureFlag.add(:creator_onboarding)
FeatureFlag.enable(:creator_onboarding)
end
end
end

View file

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