Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[588] part 2, delete One Login pre release banners flag from features #10281

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_pre_release_banners).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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
context 'when the feature flag exist' do
context 'when the feature flag exists' do

it 'removes the relevant feature flags' do
create(:feature, name: 'one_login_pre_release_banners')
create(:feature, name: 'some_other_feature_flag')

expect { described_class.new.change }.to change { Feature.count }.by(-1)
expect(Feature.where(name: 'one_login_pre_release_banners')).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
Loading