diff --git a/app/controllers/legacy_tasks_controller.rb b/app/controllers/legacy_tasks_controller.rb index ebb36f79036..2f68f438334 100644 --- a/app/controllers/legacy_tasks_controller.rb +++ b/app/controllers/legacy_tasks_controller.rb @@ -126,7 +126,7 @@ def update private def validate_user_id - fail(Caseflow::Error::InvalidUserId, user_id: params[:user_id]) unless user + fail(ActiveRecord::RecordNotFound, user_id: params[:user_id]) unless user end def validate_user_role diff --git a/spec/controllers/legacy_tasks_controller_spec.rb b/spec/controllers/legacy_tasks_controller_spec.rb index ea72d213b35..13e7e0182c6 100644 --- a/spec/controllers/legacy_tasks_controller_spec.rb +++ b/spec/controllers/legacy_tasks_controller_spec.rb @@ -73,10 +73,10 @@ end end context "CSS_ID in URL is invalid" do - it "returns 400" do + it "returns 404" do [-1, "BAD_CSS_ID", ""].each do |user_id_path| get :index, params: { user_id: user_id_path, rest: "/assign" } - expect(response.status).to eq 400 + expect(response.status).to eq 404 end end end