Remove profile admin feature flag (#17194)
Remove test cases built around it (modified when the guards were removed).
This commit is contained in:
parent
8bed053f85
commit
8276d1d8c6
5 changed files with 38 additions and 26 deletions
|
|
@ -0,0 +1,7 @@
|
|||
module DataUpdateScripts
|
||||
class RemoveProfileAdminFlag
|
||||
def run
|
||||
FeatureFlag.remove(:profile_admin)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
require "rails_helper"
|
||||
require Rails.root.join(
|
||||
"lib/data_update_scripts/20220408203135_remove_profile_admin_flag.rb",
|
||||
)
|
||||
|
||||
describe DataUpdateScripts::RemoveProfileAdminFlag do
|
||||
it "causes enabled? to be false" do
|
||||
FeatureFlag.enable(:profile_admin)
|
||||
|
||||
described_class.new.run
|
||||
|
||||
expect(FeatureFlag.enabled?(:profile_admin)).to be false
|
||||
end
|
||||
|
||||
it "removes the profile_admin flag" do
|
||||
FeatureFlag.enable(:profile_admin)
|
||||
|
||||
described_class.new.run
|
||||
|
||||
expect(FeatureFlag.exist?(:profile_admin)).to be false
|
||||
end
|
||||
|
||||
it "works if the flag does not exist" do
|
||||
FeatureFlag.remove(:profile_admin)
|
||||
|
||||
described_class.new.run
|
||||
|
||||
expect(FeatureFlag.exist?(:profile_admin)).to be false
|
||||
end
|
||||
end
|
||||
|
|
@ -89,13 +89,6 @@ RSpec.describe AdminMenu do
|
|||
|
||||
it { is_expected.to be_a(Menu::Item) }
|
||||
it { is_expected.to be_visible }
|
||||
|
||||
context "when :profile_field FeatureFlag is not enabled" do
|
||||
# leaving this in place to make sure item is visible even if flag not enabled
|
||||
before { allow(FeatureFlag).to receive(:enabled?).with(:profile_admin).and_return(false) }
|
||||
|
||||
it { is_expected.to be_visible }
|
||||
end
|
||||
end
|
||||
|
||||
describe "scope :apps" do
|
||||
|
|
|
|||
|
|
@ -27,14 +27,6 @@ RSpec.describe "admin sidebar", type: :request do
|
|||
end
|
||||
|
||||
describe "profile admin feature flag" do
|
||||
it "shows the option in the sidebar even when the feature flag is disabled" do
|
||||
allow(FeatureFlag).to receive(:enabled?).with(:profile_admin).and_return(false)
|
||||
|
||||
get admin_articles_path
|
||||
|
||||
expect(response.body).to include("Profile Fields")
|
||||
end
|
||||
|
||||
it "shows the option in the sidebar" do
|
||||
get admin_articles_path
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,7 @@
|
|||
require "rails_helper"
|
||||
|
||||
RSpec.describe "Profile admin routes", type: :routing do
|
||||
it "renders the profile admin route if the feature flag is enabled" do
|
||||
expect(get: admin_profile_fields_path).to route_to(
|
||||
controller: "admin/profile_fields",
|
||||
action: "index",
|
||||
locale: nil,
|
||||
)
|
||||
end
|
||||
|
||||
it "renders the profile admin route even if the feature flag is disabled" do
|
||||
allow(FeatureFlag).to receive(:enabled?).with(:profile_admin).and_return(false)
|
||||
|
||||
it "renders the profile admin route" do
|
||||
expect(get: admin_profile_fields_path).to route_to(
|
||||
controller: "admin/profile_fields",
|
||||
action: "index",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue