generated from ita-social-projects/DevTemplate
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #926 from ita-social-projects/799-fix-error-pages
799 fix error pages
- Loading branch information
Showing
16 changed files
with
98 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@layer components { | ||
.error-section { | ||
@apply mx-auto space-y-4 text-center rounded-lg py-36 bg-white/10 text-success backdrop-blur-md max-w-1230 | ||
} | ||
|
||
.error-section .error-code { | ||
@apply font-bold text-7xl | ||
} | ||
|
||
.error-section .error-title { | ||
@apply text-4xl font-bold | ||
} | ||
|
||
.error-section .error-description { | ||
@apply px-8 text-lg | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class ErrorsController < ApplicationController | ||
def not_found | ||
render status: :not_found | ||
end | ||
|
||
def unprocessable | ||
render status: :unprocessable_entity | ||
end | ||
|
||
def internal_server | ||
render status: :internal_server_error | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<section class="error-section"> | ||
<p class="error-code">500</p> | ||
<p class="error-title"><%= t('500_page.title') %></h1> | ||
<p class="error-description"><%= t('500_page.description') %></p> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<section class="error-section"> | ||
<p class="error-code">404</p> | ||
<p class="error-title"><%= t('404_page.title') %></h1> | ||
<p class="error-description"><%= t('404_page.description') %></p> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<section class="error-section"> | ||
<p class="error-code">422</p> | ||
<p class="error-title"><%= t('422_page.title') %></h1> | ||
<p class="error-description"><%= t('422_page.description') %></p> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe ErrorsController, type: :request do | ||
describe "GET #not_found" do | ||
it "returns a 404 status" do | ||
get not_found_error_path | ||
|
||
expect(response).to have_http_status(:not_found) | ||
end | ||
end | ||
|
||
describe "GET #unprocessable" do | ||
it "returns a 422 status" do | ||
get unprocessable_error_path | ||
|
||
expect(response).to have_http_status(:unprocessable_entity) | ||
end | ||
end | ||
|
||
describe "GET #internal_server" do | ||
it "returns a 500 status" do | ||
get internal_server_error_path | ||
|
||
expect(response).to have_http_status(:internal_server_error) | ||
end | ||
end | ||
end |