-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows us to separate routing between the School Placements service and the Track & Pay service.
- Loading branch information
1 parent
0fce159
commit c453198
Showing
14 changed files
with
147 additions
and
12 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,2 @@ | ||
class Claims::PagesController < ApplicationController | ||
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,2 @@ | ||
class Placements::PagesController < ApplicationController | ||
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 |
---|---|---|
@@ -1,2 +1,10 @@ | ||
module ApplicationHelper | ||
def current_service | ||
case request.host | ||
when ENV["CLAIMS_HOST"] | ||
:claims | ||
when ENV["PLACEMENTS_HOST"] | ||
:placements | ||
end | ||
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,26 @@ | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-xl">It works! 🎉</h1> | ||
|
||
<p class="govuk-body"> | ||
Your application is ready - so long as this page rendered without any errors you're good to go. | ||
</p> | ||
|
||
<%= govuk_summary_list( | ||
rows: [ | ||
{ key: { text: "Service" }, value: { text: "Claims" } }, | ||
{ key: { text: "Rails version" }, value: { text: Rails.version } }, | ||
{ key: { text: "Ruby version" }, value: { text: RUBY_VERSION } }, | ||
{ key: { | ||
text: "GOV.UK Frontend" }, | ||
value: { | ||
text: JSON | ||
.parse(File.read(Rails.root.join("package.json"))) | ||
.dig("dependencies", "govuk-frontend") | ||
.tr("^", "") | ||
} | ||
} | ||
] | ||
) %> | ||
</div> | ||
</div> |
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,26 @@ | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-xl">It works! 🎉</h1> | ||
|
||
<p class="govuk-body"> | ||
Your application is ready - so long as this page rendered without any errors you're good to go. | ||
</p> | ||
|
||
<%= govuk_summary_list( | ||
rows: [ | ||
{ key: { text: "Service" }, value: { text: "Placements" } }, | ||
{ key: { text: "Rails version" }, value: { text: Rails.version } }, | ||
{ key: { text: "Ruby version" }, value: { text: RUBY_VERSION } }, | ||
{ key: { | ||
text: "GOV.UK Frontend" }, | ||
value: { | ||
text: JSON | ||
.parse(File.read(Rails.root.join("package.json"))) | ||
.dig("dependencies", "govuk-frontend") | ||
.tr("^", "") | ||
} | ||
} | ||
] | ||
) %> | ||
</div> | ||
</div> |
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,6 @@ | ||
en: | ||
layouts: | ||
application: | ||
claims: | ||
header: | ||
service_name: Claim Funding for General Mentors |
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,6 @@ | ||
en: | ||
layouts: | ||
application: | ||
placements: | ||
header: | ||
service_name: Manage School Placements |
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,3 @@ | ||
scope module: :claims, as: :claims, constraints: { host: ENV["CLAIMS_HOST"] } do | ||
root to: "pages#index" | ||
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,3 @@ | ||
scope module: :placements, as: :placements, constraints: { host: ENV["PLACEMENTS_HOST"] } do | ||
root to: "pages#index" | ||
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
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,57 @@ | ||
require "rails_helper" | ||
|
||
RSpec.feature "Home Page" do | ||
after do | ||
Capybara.app_host = nil | ||
end | ||
|
||
scenario "User visits the claims homepage" do | ||
given_i_am_on_the_claims_site | ||
and_i_am_on_the_start_page | ||
i_can_see_the_claims_service_name_in_the_header | ||
and_i_can_see_the_claims_service_value_in_the_page | ||
end | ||
|
||
scenario "User visits the placements homepage" do | ||
given_i_am_on_the_placements_site | ||
and_i_am_on_the_start_page | ||
i_can_see_the_placements_service_name_in_the_header | ||
and_i_can_see_the_placements_service_value_in_the_page | ||
end | ||
|
||
private | ||
|
||
def given_i_am_on_the_claims_site | ||
ENV["CLAIMS_HOST"] = "claims.localhost" | ||
Capybara.app_host = "http://#{ENV["CLAIMS_HOST"]}" | ||
end | ||
|
||
def given_i_am_on_the_placements_site | ||
ENV["PLACEMENTS_HOST"] = "placements.localhost" | ||
Capybara.app_host = "http://#{ENV["PLACEMENTS_HOST"]}" | ||
end | ||
|
||
def and_i_am_on_the_start_page | ||
visit "/" | ||
end | ||
|
||
def i_can_see_the_claims_service_name_in_the_header | ||
within(".govuk-header") do | ||
expect(page).to have_content("Claim Funding for General Mentors") | ||
end | ||
end | ||
|
||
def i_can_see_the_placements_service_name_in_the_header | ||
within(".govuk-header") do | ||
expect(page).to have_content("Manage School Placements") | ||
end | ||
end | ||
|
||
def and_i_can_see_the_claims_service_value_in_the_page | ||
expect(page).to have_css(".govuk-summary-list__value", text: "Claims") | ||
end | ||
|
||
def and_i_can_see_the_placements_service_value_in_the_page | ||
expect(page).to have_css(".govuk-summary-list__value", text: "Placements") | ||
end | ||
end |