Skip to content

Commit

Permalink
Update Support providers uses accredited
Browse files Browse the repository at this point in the history
  • Loading branch information
inulty-dfe committed Jan 21, 2025
1 parent ef07a05 commit d4480da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/forms/support/update_provider_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def assign_attributes
end

def remove_accredited_provider_number
return unless @provider.accrediting_provider_changed?(to: 'not_an_accredited_provider')
return unless @provider.accredited_changed?(to: false)

@provider.accredited_provider_number = nil
end
Expand Down
2 changes: 1 addition & 1 deletion spec/forms/support/update_provider_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Support

describe '#save' do
context 'provider is changed from accredited_provider to not accredited_provider' do
let(:attributes) { { accrediting_provider: 'not_an_accredited_provider' } }
let(:attributes) { { accredited: false } }

it 'removes the accredited_provider_number' do
expect { subject.save }.to change(provider.reload, :accredited_provider_number).from(provider.accredited_provider_number).to(nil)
Expand Down
2 changes: 1 addition & 1 deletion spec/system/support/update_provider_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
expect(page.find('.govuk-summary-list__value').text).to eq(provider.accredited_provider_number.to_s)
click_on('Change')
end
page.find_by_id('provider-accrediting-provider-not-an-accredited-provider-field', visible: false).click
page.find_by_id('provider-accredited-field', visible: false).click

click_on 'Update organisation details'
expect(page).to have_current_path("/support/#{RecruitmentCycle.current.year}/providers/#{provider.id}")
Expand Down

0 comments on commit d4480da

Please sign in to comment.