chore(attestation): card link to v2 if exist
This commit is contained in:
parent
151b3f83ed
commit
ffd8c5617a
3 changed files with 16 additions and 2 deletions
|
@ -14,8 +14,14 @@ describe 'As an administrateur, I want to manage the procedure’s attestation',
|
|||
before { login_as(administrateur.user, scope: :user) }
|
||||
|
||||
def find_attestation_card(with_nested_selector: nil)
|
||||
attestation_path = if procedure.attestation_template&.version == 2 || procedure.feature_enabled?(:attestation_v2)
|
||||
edit_admin_procedure_attestation_template_v2_path(procedure)
|
||||
else
|
||||
edit_admin_procedure_attestation_template_path(procedure)
|
||||
end
|
||||
|
||||
full_selector = [
|
||||
"a[href=\"#{edit_admin_procedure_attestation_template_path(procedure)}\"]",
|
||||
"a[href=\"#{attestation_path}\"]",
|
||||
with_nested_selector
|
||||
].compact.join(" ")
|
||||
page.find(full_selector)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue