-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9839 from alphagov/content-modelling/refactor-cuc…
…umber Content modelling/refactor cucumber
- Loading branch information
Showing
19 changed files
with
555 additions
and
563 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
33 changes: 33 additions & 0 deletions
33
lib/engines/content_block_manager/features/step_definitions/back_link_steps.rb
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,33 @@ | ||
Then("I should see a back link to the select schema page") do | ||
expect(page).to have_link("Back", href: content_block_manager.new_content_block_manager_content_block_document_path) | ||
end | ||
|
||
Then("I should see a back link to the document page") do | ||
expect(page).to have_link( | ||
"Back", | ||
href: content_block_manager.content_block_manager_content_block_document_path(@content_block.document), | ||
) | ||
end | ||
|
||
Then("I should see a back link to the show page") do | ||
match_data = URI.parse(page.current_url).path.match(%r{content-block-editions/(\d+)/edit$}) | ||
id = match_data[1] unless match_data.nil? | ||
expect(id).not_to be_nil, "Could not find an existing content block edition ID in the URL" | ||
expect(page).to have_link("Back", href: content_block_manager.content_block_manager_content_block_edition_path(id)) | ||
end | ||
|
||
Then(/^I should see a back link to the "([^"]*)" step$/) do |step| | ||
link = if step == "edit" | ||
content_block_manager.new_content_block_manager_content_block_document_edition_path(@content_block.document) | ||
else | ||
content_block_manager.content_block_manager_content_block_workflow_path( | ||
@content_block.document.editions.last, | ||
step:, | ||
) | ||
end | ||
expect(page).to have_link("Back", href: link) | ||
end | ||
|
||
Then("I should see a back link to the document list page") do | ||
expect(page).to have_link("Back", href: content_block_manager.content_block_manager_content_block_documents_path) | ||
end |
Oops, something went wrong.