docbrown/spec/routing/data_update_scripts_admin_routes_spec.rb
Ridhwana a61f88fc16
Adds a feature flag for Data Update Scripts (#12641)
* feat: add a feature flag for data update scripts

* feat: write some tests for it

* chore: oops

* stub the data update scripts out wherever the profile admin is

* chore: remove some unneeded ones

* refactor: use call_original

* feat: add a feature flag to all the Forems (but not enable it as yet)
2021-02-10 18:22:27 +02:00

23 lines
786 B
Ruby

require "rails_helper"
RSpec.describe "Data Update Scripts admin routes", type: :routing do
it "renders the data update scripts admin route if the feature flag is enabled" do
allow(FeatureFlag).to receive(:enabled?).with(:data_update_scripts).and_return(true)
expect(get: admin_data_update_scripts_path).to route_to(
controller: "admin/data_update_scripts",
action: "index",
locale: nil,
)
end
it "does not render the data update scripts admin route if the feature flag is disabled" do
allow(FeatureFlag).to receive(:enabled?).with(:data_update_scripts).and_return(false)
expect(get: admin_data_update_scripts_path).not_to route_to(
controller: "admin/data_update_scripts",
action: "index",
locale: nil,
)
end
end