Add feature flag exception for the module polls
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
class Admin::Poll::BaseController < Admin::BaseController
|
||||
include FeatureFlags
|
||||
|
||||
feature_flag :polls
|
||||
|
||||
helper_method :namespace
|
||||
|
||||
private
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
class PollsController < ApplicationController
|
||||
include FeatureFlags
|
||||
include PollsHelper
|
||||
|
||||
feature_flag :polls
|
||||
|
||||
before_action :load_poll, except: [:index]
|
||||
before_action :load_active_poll, only: :index
|
||||
|
||||
|
||||
@@ -6,6 +6,11 @@ describe "Admin polls" do
|
||||
login_as(admin.user)
|
||||
end
|
||||
|
||||
scenario "Disabled with a feature flag" do
|
||||
Setting["process.polls"] = nil
|
||||
expect { visit admin_polls_path }.to raise_exception(FeatureFlags::FeatureDisabled)
|
||||
end
|
||||
|
||||
scenario "Index empty", :js do
|
||||
visit admin_root_path
|
||||
|
||||
|
||||
@@ -5,6 +5,11 @@ describe "Polls" do
|
||||
it_behaves_like "notifiable in-app", :poll
|
||||
end
|
||||
|
||||
scenario "Disabled with a feature flag" do
|
||||
Setting["process.polls"] = nil
|
||||
expect { visit polls_path }.to raise_exception(FeatureFlags::FeatureDisabled)
|
||||
end
|
||||
|
||||
context "#index" do
|
||||
scenario "Shows description for open polls" do
|
||||
visit polls_path
|
||||
|
||||
Reference in New Issue
Block a user