Add feature flags on budget controllers

Although we had this feature flag in most places, we forgot to add it in
some of the controllers.
This commit is contained in:
Javi Martín
2021-03-31 14:35:05 +02:00
parent 9981202c45
commit b5bc3117ac
6 changed files with 34 additions and 0 deletions

View File

@@ -2,6 +2,14 @@ require "rails_helper"
describe Budgets::StatsController do
describe "GET show" do
it "raises an exception when the feature is disabled" do
Setting["process.budgets"] = false
expect do
get :show, params: { budget_id: create(:budget).id }
end.to raise_exception(FeatureFlags::FeatureDisabled)
end
it "raises an error if budget slug is not found" do
expect do
get :show, params: { budget_id: "wrong_budget" }