Add admin_member_view Feature Flag (#16346)
* Adds an admin_member_view feature flag and spec * Adds the admin_member_view FeatureFlag to seeds_e2e for testing
This commit is contained in:
parent
6fb7361552
commit
5afcdb3f71
3 changed files with 36 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
module DataUpdateScripts
|
||||
class AddAdminMemberViewFeatureFlag
|
||||
def run
|
||||
FeatureFlag.add(:admin_member_view)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
require "rails_helper"
|
||||
require Rails.root.join(
|
||||
"lib/data_update_scripts/20220128150709_add_admin_member_view_feature_flag.rb",
|
||||
)
|
||||
|
||||
describe DataUpdateScripts::AddAdminMemberViewFeatureFlag do
|
||||
after do
|
||||
FeatureFlag.remove(:admin_member_view)
|
||||
end
|
||||
|
||||
it "adds the :admin_member_view flag" do
|
||||
expect do
|
||||
described_class.new.run
|
||||
end.to change { FeatureFlag.exist?(:admin_member_view) }.from(false).to(true)
|
||||
end
|
||||
|
||||
it "works if the flag is already available" do
|
||||
FeatureFlag.add(:admin_member_view)
|
||||
|
||||
expect do
|
||||
described_class.new.run
|
||||
end.not_to change { FeatureFlag.exist?(:admin_member_view) }
|
||||
end
|
||||
end
|
||||
|
|
@ -64,6 +64,11 @@ admin_user = User.find_by(email: "admin@forem.local")
|
|||
|
||||
##############################################################################
|
||||
|
||||
# Enable Admin Member View feature flag for tests
|
||||
FeatureFlag.enable(:admin_member_view)
|
||||
|
||||
##############################################################################
|
||||
|
||||
seeder.create_if_doesnt_exist(User, "email", "trusted-user-1@forem.local") do
|
||||
user = User.create!(
|
||||
name: "Trusted User 1 \\:/",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue