Skip to content

Commit

Permalink
Delete One Login pre release banners flag from features
Browse files Browse the repository at this point in the history
  • Loading branch information
elceebee committed Jan 20, 2025
1 parent 072f149 commit 3a901fc
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class RemoveNewWithdrawalReasonsFeatureFlag
MANUAL_RUN = false

def change
Feature.where(name: :new_candidate_withdrawal_reasons).delete_all
Feature.where(name: :one_login_candidate_sign_in).delete_all
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module DataMigrations
class RemoveOneLoginPreReleaseBannersFeatureFlag
TIMESTAMP = 20250120150435
MANUAL_RUN = false

def change
Feature.where(name: :one_login_candidate_sign_in).delete_all
end
end
end
1 change: 1 addition & 0 deletions lib/tasks/data.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
DATA_MIGRATION_SERVICES = [
# do not delete or edit this line - services added below by generator
'DataMigrations::RemoveOneLoginPreReleaseBannersFeatureFlag',
'DataMigrations::RemoveNewWithdrawalReasonsFeatureFlag',
'DataMigrations::RemoveUnusedFeatureFlags',
'DataMigrations::RemoveTdaFlag',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require 'rails_helper'

RSpec.describe DataMigrations::RemoveOneLoginPreReleaseBannersFeatureFlag do
context 'when the feature flag exist' do
it 'removes the relevant feature flags' do
create(:feature, name: 'one_login_candidate_sign_in')
create(:feature, name: 'some_other_feature_flag')

expect { described_class.new.change }.to change { Feature.count }.by(-1)
expect(Feature.where(name: 'one_login_candidate_sign_in')).to be_none
expect(Feature.where(name: 'some_other_feature_flag')).to be_any
end
end

context 'when the feature flags have already been dropped' do
it 'does nothing' do
expect { described_class.new.change }.not_to(change { Feature.count })
end
end
end

0 comments on commit 3a901fc

Please sign in to comment.