Skip to content

Commit

Permalink
Redirect to 404 page if css_id in URL is invalid (#14172)
Browse files Browse the repository at this point in the history
* redirect to our normal 404 page if css_id is invalid
* update test
  • Loading branch information
yoomlam authored May 4, 2020
1 parent 3e1461b commit ff59e90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/legacy_tasks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/legacy_tasks_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ff59e90

Please sign in to comment.