Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[541] remove unused application complete path #10200

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def interstitial
current_candidate.update!(course_from_find_id: nil)

if current_application.submitted? && current_application.v23?
redirect_to candidate_interface_application_complete_path
redirect_to candidate_interface_start_carry_over_path
elsif current_application.contains_course?(course_from_find)
flash[:warning] = "You have already added an application for #{course_from_find.name}. #{view_context.link_to('Find a different course to apply to', find_url, class: 'govuk-link')}."
redirect_to course_choices_page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def redirect_to_post_offer_dashboard_if_accepted_deferred_or_recruited
end

def redirect_to_completed_dashboard_if_not_accepted_deferred_or_recruited
redirect_to candidate_interface_application_complete_path if no_offers_accepted_or_deferred_and_not_recruited?
redirect_to candidate_interface_application_choices_path if no_offers_accepted_or_deferred_and_not_recruited?
end

def redirect_to_candidate_root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def create
@feedback_form = FeedbackForm.new(feedback_params)
if @feedback_form.save(current_application)
flash[:success] = t('application_form.submit_application_success.title')
redirect_to candidate_interface_application_complete_path
redirect_to candidate_interface_details_path
else
track_validation_error(@feedback_form)
render :new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module CandidateInterface
class RejectionFeedbackSurveyController < CandidateInterfaceController
def new
ProvideRejectionFeedback.new(application_choice_params, helpful_params).call
redirect_to candidate_interface_application_complete_path
redirect_to candidate_interface_application_choices_path
flash[:success] = 'Feedback successfully provided'
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
module CandidateInterface
class SubmittedApplicationFormController < CandidateInterfaceController
before_action CarryOverFilter, only: %i[complete]
before_action AlreadyCarriedOverFilter, only: %i[complete]

def review_submitted
@application_form = current_application
end

def complete
@candidate = current_candidate
@application_form = current_application
end
end
end
4 changes: 1 addition & 3 deletions app/filters/unsuccessful_carry_over_filter.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
class UnsuccessfulCarryOverFilter < ApplicationFilter
delegate :candidate_interface_application_complete_path, to: :controller

def call
return if CycleTimetable.can_add_course_choice?(current_application) || current_application.carry_over?

redirect_to candidate_interface_application_complete_path if current_application.v23?
redirect_to candidate_interface_start_carry_over_path if current_application.v23?
end
end
2 changes: 1 addition & 1 deletion app/views/candidate_interface/decisions/offer.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :title, title_with_error_prefix(t('page_titles.decisions.offer'), @respond_to_offer.errors.any?) %>
<% content_for :before_content, govuk_back_link_to(candidate_interface_application_complete_path) %>
<% content_for :before_content, govuk_back_link_to(candidate_interface_application_choices_path) %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion config/routes/candidate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
get '/prefill', to: 'prefill_application_form#new'
post '/prefill', to: 'prefill_application_form#create'

get '/complete' => 'submitted_application_form#complete', as: :application_complete
get '/review/submitted' => 'submitted_application_form#review_submitted', as: :application_review_submitted

scope '/manage-conditions' do
Expand Down

This file was deleted.

7 changes: 0 additions & 7 deletions spec/requests/candidate_interface/cycle_redirects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
expect(response).to redirect_to(candidate_interface_details_path)
end
end

context 'when accessing the complete route' do
it 'redirects to the application details' do
get candidate_interface_application_complete_path
expect(response).to redirect_to(candidate_interface_details_path)
end
end
end

context 'when not continuous applications', time: mid_cycle do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
it 'redirects to the complete path' do
get candidate_interface_request_reference_references_start_path

expect(response).to redirect_to(candidate_interface_application_complete_path)
expect(response).to redirect_to(candidate_interface_application_choices_path)
end
end

Expand Down
4 changes: 0 additions & 4 deletions spec/support/test_helpers/candidate_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,6 @@ def application_choice
current_candidate.current_application.application_choices.last
end

def when_i_visit_the_application_complete_page
visit candidate_interface_application_complete_path
end

def then_i_am_on_your_details_page
expect(page).to have_current_path(candidate_interface_details_path)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def when_i_sign_in_again
end

def and_i_visit_the_application_dashboard
visit candidate_interface_application_complete_path
visit candidate_interface_application_choices_path
end

def then_i_cannot_submit_my_application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def then_i_am_ask_to_apply_for_courses_into_the_new_recruitment_cycle
def then_i_am_on_the_pages_that_is_possible_to_carry_over_an_application
# rubocop:disable Capybara/CurrentPathExpectation
expect(page.current_path).to eq(candidate_interface_start_carry_over_path)
.or(eq(candidate_interface_application_complete_path))
# rubocop:enable Capybara/CurrentPathExpectation
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
then_i_am_redirect_to_your_applications_tab

when_i_visit_the_old_complete_page
then_i_am_redirected_to_continuous_application_details_page
then_i_see_a_404_page
end

scenario 'candidate carries over unsubmitted application after find opens deadline' do
Expand All @@ -45,7 +45,7 @@
then_i_am_redirect_to_your_applications_tab

when_i_visit_the_old_complete_page
then_i_am_redirected_to_continuous_application_details_page
then_i_see_a_404_page
end

scenario 'candidate carries over submitted application after find opens deadline' do
Expand All @@ -65,7 +65,7 @@
then_i_am_redirect_to_your_applications_tab

when_i_visit_the_old_complete_page
then_i_am_redirected_to_continuous_application_details_page
then_i_see_a_404_page
end

private
Expand Down Expand Up @@ -170,10 +170,6 @@ def when_i_got_rejected_by_a_provider
end
end

def then_i_am_redirected_to_complete_page
expect(page).to have_current_path(candidate_interface_application_complete_path)
end

def when_i_carry_over
click_link_or_button 'Update your details'
end
Expand All @@ -183,6 +179,10 @@ def then_i_am_redirected_to_continuous_application_details_page
then_i_see_a_copy_of_my_application
end

def then_i_see_a_404_page
expect(page).to have_content 'Page not found'
end

def when_i_go_to_your_applications_tab
click_link_or_button 'Your application'
end
Expand Down Expand Up @@ -211,7 +211,7 @@ def then_i_am_redirect_to_your_applications_tab
end

def when_i_visit_the_old_complete_page
visit candidate_interface_application_complete_path
visit '/application/complete'
end

def then_i_see_a_copy_of_my_application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
when_i_click_on_the_references_section
then_i_see_the_new_states_of_my_references

when_i_visit_the_application_complete_page
when_i_visit_the_application_dashboard
then_i_am_on_your_details_page
end

Expand Down Expand Up @@ -65,6 +65,7 @@ def when_i_click_on_the_references_section
def and_i_visit_the_application_dashboard
visit root_path
end
alias_method :when_i_visit_the_application_dashboard, :and_i_visit_the_application_dashboard

def and_references_is_marked_as_incomplete
expect(safeguarding_section.text.downcase).to include('references to be requested if you accept an offer incomplete')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def and_the_apply_deadline_passes
def and_i_visit_my_application_complete_page
logout
login_as(@candidate)
visit candidate_interface_application_complete_path
visit candidate_interface_application_choices_path
end

def and_i_refresh_the_page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def and_i_have_an_accepted_offer
end

def when_i_visit_the_application_dashboard
visit candidate_interface_application_complete_path
visit candidate_interface_application_choices_path
end

def then_i_see_the_post_offer_dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def when_the_provider_marks_my_application_as_recruited
end

def and_i_view_my_application
visit candidate_interface_application_complete_path
visit candidate_interface_application_choices_path
end

def then_i_see_the_new_dashboard_content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def when_the_provider_marks_my_application_as_recruited
end

def and_i_view_my_application
visit candidate_interface_application_complete_path
visit candidate_interface_application_choices_path
end

def then_i_see_the_new_dashboard_content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def and_i_have_a_deferred_offer
end

def when_i_visit_the_application_dashboard
visit candidate_interface_application_complete_path
visit candidate_interface_application_choices_path
end

def then_i_see_the_post_offer_dashboard
Expand Down
Loading
Loading