|
|
|
@ -14,20 +14,35 @@ RSpec.describe MaintenanceController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when a user visits a page other than the maintenance page" do |
|
|
|
context "when a user visits a page other than the maintenance page" do |
|
|
|
it "redirects the user to the maintenance page" do |
|
|
|
before do |
|
|
|
get "/lettings-logs" |
|
|
|
get "/lettings-logs" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "redirects the user to the maintenance page" do |
|
|
|
expect(response).to redirect_to(service_unavailable_path) |
|
|
|
expect(response).to redirect_to(service_unavailable_path) |
|
|
|
follow_redirect! |
|
|
|
follow_redirect! |
|
|
|
expect(page).to have_content("Sorry, the service is unavailable") |
|
|
|
expect(page).to have_content("Sorry, the service is unavailable") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "the cookie banner is visible" do |
|
|
|
|
|
|
|
follow_redirect! |
|
|
|
|
|
|
|
expect(page).to have_content("We’d like to use analytics cookies so we can understand how you use the service and make improvements.") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when a user visits the maintenance page" do |
|
|
|
context "when a user visits the maintenance page" do |
|
|
|
it "keeps the user on the maintenance page" do |
|
|
|
before do |
|
|
|
get "/service-unavailable" |
|
|
|
get "/service-unavailable" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "keeps the user on the maintenance page" do |
|
|
|
expect(response).not_to redirect_to(service_unavailable_path) |
|
|
|
expect(response).not_to redirect_to(service_unavailable_path) |
|
|
|
expect(page).to have_content("Sorry, the service is unavailable") |
|
|
|
expect(page).to have_content("Sorry, the service is unavailable") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "the cookie banner is visible" do |
|
|
|
|
|
|
|
expect(page).to have_content("We’d like to use analytics cookies so we can understand how you use the service and make improvements.") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -37,18 +52,34 @@ RSpec.describe MaintenanceController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when a user visits a page other than the maintenance page" do |
|
|
|
context "when a user visits a page other than the maintenance page" do |
|
|
|
it "doesn't redirect the user to the maintenance page" do |
|
|
|
before do |
|
|
|
get "/lettings-logs" |
|
|
|
get "/lettings-logs" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "doesn't redirect the user to the maintenance page" do |
|
|
|
expect(response).not_to redirect_to(service_unavailable_path) |
|
|
|
expect(response).not_to redirect_to(service_unavailable_path) |
|
|
|
expect(page).to have_content("Create a new lettings log") |
|
|
|
expect(page).to have_content("Create a new lettings log") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "the cookie banner is visible" do |
|
|
|
|
|
|
|
expect(page).to have_content("We’d like to use analytics cookies so we can understand how you use the service and make improvements.") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when a user visits the maintenance page" do |
|
|
|
context "when a user visits the maintenance page" do |
|
|
|
it "redirects the user to the start page" do |
|
|
|
before do |
|
|
|
get "/service-unavailable" |
|
|
|
get "/service-unavailable" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "redirects the user to the start page" do |
|
|
|
expect(response).to redirect_to(root_path) |
|
|
|
expect(response).to redirect_to(root_path) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "the cookie banner is visible" do |
|
|
|
|
|
|
|
follow_redirect! |
|
|
|
|
|
|
|
follow_redirect! |
|
|
|
|
|
|
|
expect(page).to have_content("We’d like to use analytics cookies so we can understand how you use the service and make improvements.") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|