Browse Source

Enable sales logs on production (#1352)

CLDC-1864-question-numbering-too v0.3.0
James Rose 2 years ago committed by GitHub
parent
commit
c418312b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      config/initializers/feature_toggle.rb
  2. 4
      spec/features/sales_log_spec.rb
  3. 12
      spec/helpers/navigation_items_helper_spec.rb

2
config/initializers/feature_toggle.rb

@ -13,7 +13,7 @@ class FeatureToggle
end
def self.sales_log_enabled?
!Rails.env.production?
true
end
def self.managing_owning_enabled?

4
spec/features/sales_log_spec.rb

@ -53,9 +53,9 @@ RSpec.describe "Sales Log Features" do
end
end
context "when the sales log feature flag is toggled" do
context "when the sales log feature flag is disabled" do
before do
allow(Rails.env).to receive(:production?).and_return(true)
allow(FeatureToggle).to receive(:sales_log_enabled?).and_return(false)
end
it "hides the create sales log button in production" do

12
spec/helpers/navigation_items_helper_spec.rb

@ -7,9 +7,10 @@ RSpec.describe NavigationItemsHelper do
let(:organisation_path) { "/organisations/#{current_user.organisation.id}" }
describe "#primary items" do
context "when the sales log feature flag is enabled" do
context "when the sales log feature flag is disabled" do
before do
allow(Rails.env).to receive(:production?).and_return(true)
allow(FeatureToggle).to receive(:sales_log_enabled?).and_return(false)
allow(FeatureToggle).to receive(:managing_owning_enabled?).and_return(false)
end
context "when the user is a data coordinator" do
@ -336,7 +337,12 @@ RSpec.describe NavigationItemsHelper do
end
end
context "when the sales log feature flag is disabled" do
context "when the sales log feature flag is enabled" do
before do
allow(FeatureToggle).to receive(:sales_log_enabled?).and_return(true)
allow(FeatureToggle).to receive(:managing_owning_enabled?).and_return(true)
end
context "when the user is a data coordinator" do
context "when the user is on the lettings logs page" do
let(:expected_navigation_items) do

Loading…
Cancel
Save