Skip to content

Commit

Permalink
RST-5583 Forgot summary page has scheme row (#1458)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaparka authored Aug 2, 2023
1 parent 6acbcb6 commit db0c6cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/models/views/confirmation/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ module Confirmation
class Result < Views::Overview::Base

def all_fields
['discretion_applied?', 'savings_passed?', 'benefits_passed?', 'income_passed?', 'calculation_scheme']
list = ['discretion_applied?', 'savings_passed?', 'benefits_passed?', 'income_passed?']
list << 'calculation_scheme' if FeatureSwitching.active?(:band_calculation)
list
end

def initialize(application)
Expand Down
9 changes: 8 additions & 1 deletion spec/models/views/confirmation/result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@

describe '#all_fields' do
subject { view.all_fields }
context 'band calculation not active' do
it { is_expected.to eql ['discretion_applied?', 'savings_passed?', 'benefits_passed?', 'income_passed?'] }
end

context 'band calculation active' do
before { allow(FeatureSwitching).to receive(:active?).with(:band_calculation).and_return true }
it { is_expected.to eql ['discretion_applied?', 'savings_passed?', 'benefits_passed?', 'income_passed?', 'calculation_scheme'] }
end

it { is_expected.to eql ['discretion_applied?', 'savings_passed?', 'benefits_passed?', 'income_passed?', 'calculation_scheme'] }
end

describe '#discretion_applied?' do
Expand Down

0 comments on commit db0c6cb

Please sign in to comment.