Browse Source

Enables the supported housing feature flag (#772)

pull/782/head v0.2.0
Stéphane Meny 2 years ago committed by GitHub
parent
commit
3cc17ddc60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      config/initializers/feature_toggle.rb
  2. 11
      spec/components/primary_navigation_component_spec.rb
  3. 24
      spec/models/case_log_spec.rb

4
config/initializers/feature_toggle.rb

@ -1,8 +1,6 @@
class FeatureToggle
def self.supported_housing_schemes_enabled?
return true unless Rails.env.production?
false
true
end
def self.startdate_two_week_validation_enabled?

11
spec/components/primary_navigation_component_spec.rb

@ -39,15 +39,4 @@ RSpec.describe PrimaryNavigationComponent, type: :component do
expect(result.text).to include("Schemes")
end
end
context "when production environment" do
before do
allow(Rails.env).to receive(:production?).and_return(true)
end
it "doesn't render schemes" do
result = render_inline(described_class.new(items:))
expect(result.text).not_to include("Schemes")
end
end
end

24
spec/models/case_log_spec.rb

@ -211,19 +211,6 @@ RSpec.describe CaseLog do
})
end
context "when a case log is created in production" do
before do
allow(Rails.env).to receive(:production?).and_return(true)
end
it "derives that all forms are general needs" do
case_log = FactoryBot.create(:case_log)
record_from_db = ActiveRecord::Base.connection.execute("select needstype from case_logs where id=#{case_log.id}").to_a[0]
expect(record_from_db["needstype"]).to eq(1)
expect(case_log["needstype"]).to eq(1)
end
end
it "correctly derives and saves partial and full major repairs date" do
record_from_db = ActiveRecord::Base.connection.execute("select mrcdate from case_logs where id=#{case_log.id}").to_a[0]
expect(record_from_db["mrcdate"].day).to eq(4)
@ -2245,17 +2232,6 @@ RSpec.describe CaseLog do
case_log = FactoryBot.create(:case_log)
expect(case_log.supported_housing_schemes_enabled?).to eq(true)
end
context "when in the production environment" do
before do
allow(Rails.env).to receive(:production?).and_return(true)
end
it "returns false for a case log" do
case_log = FactoryBot.create(:case_log)
expect(case_log.supported_housing_schemes_enabled?).to eq(false)
end
end
end
describe "csv download" do

Loading…
Cancel
Save