Browse Source

Enable sales logs on production

pull/1352/head
James Rose 3 years ago
parent
commit
50b6ad21aa
  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