-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ER-815 Service Unavailable Page (#941)
* add redirect to service unavailable page * rubocop * update specs * update service unavailable redirect * add maintencance? method to application config * update spec * rename maintenance page and update spec
- Loading branch information
1 parent
e517946
commit 4cc8207
Showing
4 changed files
with
57 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,3 +81,6 @@ E2E=true | |
|
||
# Deployment environment | ||
ENVIRONMENT= | ||
|
||
# DISPLAY SERVICE_UNAVAILABLE PAGE | ||
MAINTENANCE = true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.shared_examples 'displays service unavailable page' do | ||
it 'displays the service unavailable message and title' do | ||
expect(page).to have_css('h1', text: 'Sorry, the service is unavailable') | ||
expect(page).to have_title('Early years child development training : Sorry, the service is unavailable') | ||
end | ||
end | ||
|
||
RSpec.describe 'Service Unavailable' do | ||
before do | ||
allow(Rails.application).to receive(:maintenance?).and_return(true) | ||
end | ||
|
||
context 'when the service is unavailable and user navigates to home' do | ||
before do | ||
visit '/' | ||
end | ||
|
||
it_behaves_like 'displays service unavailable page' | ||
end | ||
|
||
context 'when the service is unavailable and user navigates to my modules page' do | ||
before do | ||
visit my_modules_path | ||
end | ||
|
||
it_behaves_like 'displays service unavailable page' | ||
end | ||
|
||
context 'when the service is unavailable and user is already on the service unavailable page' do | ||
before do | ||
visit '/maintenance' | ||
end | ||
|
||
it_behaves_like 'displays service unavailable page' | ||
end | ||
end |