-
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.
- rename to remove controller name, since this ∙ is the same controller as the previous commit ∙ but a different set of features
- Loading branch information
Showing
1 changed file
with
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
RSpec.describe("Step Navigation", type: :request) do | ||
%w[guide answer publication].each do |schema_name| | ||
it "#{schema_name} shows step by step navigation where relevant" do | ||
content_item = content_store_has_schema_example(schema_name, "#{schema_name}-with-step-navs") | ||
content_item["base_path"] = "/pass-plus" | ||
stub_content_store_has_item(content_item["base_path"], content_item) | ||
allow_any_instance_of(ContentItemsController).to receive(:page_in_scope?).and_return(false) | ||
get content_item["base_path"] | ||
|
||
expect(response.status).to eq(200) | ||
expect(response.body).to include("Learn to drive a car: step by step") | ||
end | ||
|
||
it "#{schema_name} does not show step by step navigation where relevant" do | ||
content_item = content_store_has_schema_example(schema_name, schema_name) | ||
content_item["base_path"] = "/not-part-of-a-step-by-step" | ||
stub_content_store_has_item(content_item["base_path"], content_item) | ||
allow_any_instance_of(ContentItemsController).to receive(:page_in_scope?).and_return(false) | ||
|
||
get content_item["base_path"] | ||
|
||
expect(response.status).to eq(200) | ||
expect(response.body).not_to include("Learn to drive a car: step by step") | ||
end | ||
end | ||
end |