Skip to content
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
4 changes: 2 additions & 2 deletions public/403.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="user user-menu">
<a rel="nofollow" class=" btn btn-danger btn-md " data-method="delete" href="/users/sign_out"><i class="fa fa-sign-out"></i> Log out</a>
<a class="btn btn-primary btn-md" href="/"><i class="fa fa-home"></i> Home</a>
</li>
</ul>
</div>
Expand Down Expand Up @@ -63,7 +63,7 @@ <h1>403 Error Page</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item active">403 Error Page</li>
</ol>
</div>
Expand Down
4 changes: 2 additions & 2 deletions public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="user user-menu">
<a rel="nofollow" class=" btn btn-danger btn-md " data-method="delete" href="/users/sign_out"><i class="fa fa-sign-out"></i> Log out</a>
<a class="btn btn-primary btn-md" href="/"><i class="fa fa-home"></i> Home</a>
</li>
</ul>
</div>
Expand Down Expand Up @@ -64,7 +64,7 @@ <h1>404 Error Page</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item active">404 Error Page</li>
</ol>
</div>
Expand Down
4 changes: 2 additions & 2 deletions public/422.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="user user-menu">
<a rel="nofollow" class=" btn btn-danger btn-md " data-method="delete" href="/users/sign_out"><i class="fa fa-sign-out"></i> Log out</a>
<a class="btn btn-primary btn-md" href="/"><i class="fa fa-home"></i> Home</a>
</li>
</ul>
</div>
Expand Down Expand Up @@ -62,7 +62,7 @@ <h1>422 Error Page</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item active">422 Error Page</li>
</ol>
</div>
Expand Down
4 changes: 2 additions & 2 deletions public/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="user user-menu">
<a rel="nofollow" class=" btn btn-danger btn-md " data-method="delete" href="/users/sign_out"><i class="fa fa-sign-out"></i> Log out</a>
<a class="btn btn-primary btn-md" href="/"><i class="fa fa-home"></i> Home</a>
</li>
</ul>
</div>
Expand Down Expand Up @@ -62,7 +62,7 @@ <h1>500 Error Page</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item active">500 Error Page</li>
</ol>
</div>
Expand Down
26 changes: 26 additions & 0 deletions spec/features/error_pages_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require "rails_helper"

RSpec.describe "Static error pages", type: :feature do
let(:user) { create(:user) }

%w[403 404 422 500].each do |code|
context "on the #{code} error page" do
it "offers a Home link instead of a log out link" do
sign_in(user)
visit "/#{code}"

expect(page).to have_no_link("Log out")

click_link "Home", match: :first
expect(page).to have_current_path(dashboard_path)
end

it "sends signed-out visitors home to the landing page" do
visit "/#{code}"

click_link "Home", match: :first
expect(page).to have_current_path(root_path)
end
end
end
end
Loading