GRN2-192: Made error pages more descriptive (#620)

* GRN2-192

* Brought back error codes
This commit is contained in:
farhatahmad
2019-07-10 11:51:19 -04:00
committed by Jesus Federico
parent 523d9a38f2
commit c7a0c6a463
11 changed files with 38 additions and 56 deletions

View File

@ -74,7 +74,7 @@ describe ApplicationController do
it "renders a 404 error if user is not found" do
allow(Rails.configuration).to receive(:loadbalanced_configuration).and_return(true)
allow(Rails.env).to receive(:test?).and_return(false)
allow_any_instance_of(SessionsHelper).to receive(:parse_user_domain).and_return("")
allow_any_instance_of(SessionsHelper).to receive(:parse_user_domain).and_return("fake_provider")
allow_any_instance_of(BbbApi).to receive(:retrieve_provider_info).and_raise("No user with that id exists")
routes.draw { get "user_not_found" => "anonymous#user_not_found" }
@ -83,7 +83,19 @@ describe ApplicationController do
expect(response).to render_template("errors/not_found")
end
it "renders a 500 error if any other error is not found" do
it "renders a 404 error if user is not given" do
allow(Rails.configuration).to receive(:loadbalanced_configuration).and_return(true)
allow(Rails.env).to receive(:test?).and_return(false)
allow_any_instance_of(SessionsHelper).to receive(:parse_user_domain).and_return("")
allow_any_instance_of(BbbApi).to receive(:retrieve_provider_info).and_raise("Provider not included.")
routes.draw { get "user_not_found" => "anonymous#user_not_found" }
get :user_not_found
expect(response).to render_template("errors/not_found")
end
it "renders a 500 error if any other error related to bbb api" do
allow(Rails.configuration).to receive(:loadbalanced_configuration).and_return(true)
allow(Rails.env).to receive(:test?).and_return(false)
allow_any_instance_of(SessionsHelper).to receive(:parse_user_domain).and_return("")

View File

@ -26,13 +26,6 @@ describe ErrorsController, type: :controller do
end
end
describe "GET #unprocessable" do
it "returns unprocessable" do
get :unprocessable
expect(response).to have_http_status(422)
end
end
describe "GET #internal_error" do
it "returns internal_error" do
get :internal_error