-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UKVI UR banner to required pages
- Loading branch information
1 parent
d6310b4
commit 7ef4c8d
Showing
4 changed files
with
53 additions
and
0 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
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,43 @@ | ||
require "integration_spec_helper" | ||
|
||
RSpec.feature "Research panel banner" do | ||
include SearchApiHelpers | ||
include OrganisationHelpers | ||
include RecruitmentBannerHelper | ||
|
||
scenario "browse pages where we want to display UKVI banner" do | ||
base_path = "/browse/visas-immigration" | ||
schema = GovukSchemas::Example.find("mainstream_browse_page", example_name: "level_2_page") | ||
schema["base_path"] = base_path | ||
stub_content_store_has_item(schema["base_path"], schema) | ||
search_api_has_documents_for_browse_page(schema["content_id"], [base_path], page_size: SearchApiSearch::PAGE_SIZE_TO_GET_EVERYTHING) | ||
|
||
visit schema["base_path"] | ||
|
||
expect(page.status_code).to eq(200) | ||
expect(page).to have_selector(".gem-c-intervention") | ||
end | ||
|
||
scenario "organisation pages where we want to display UKVI banner" do | ||
base_path = "/government/organisations/uk-visas-and-immigration" | ||
schema = GovukSchemas::Example.find("organisation", example_name: "tribunal") | ||
schema["base_path"] = base_path | ||
stub_content_and_search(schema) | ||
|
||
visit schema["base_path"] | ||
|
||
expect(page.status_code).to eq(200) | ||
expect(page).to have_selector(".gem-c-intervention") | ||
end | ||
|
||
scenario "pages where we don't want to display UKVI banner" do | ||
schema = GovukSchemas::Example.find("mainstream_browse_page", example_name: "level_2_page") | ||
stub_content_store_has_item(schema["base_path"], schema) | ||
search_api_has_documents_for_browse_page(schema["content_id"], [schema["base_path"]], page_size: SearchApiSearch::PAGE_SIZE_TO_GET_EVERYTHING) | ||
|
||
visit schema["base_path"] | ||
|
||
expect(page.status_code).to eq(200) | ||
expect(page).to_not have_selector(".gem-c-intervention") | ||
end | ||
end |