Last active
August 29, 2015 14:00
-
-
Save bdunogier/11292331 to your computer and use it in GitHub Desktop.
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
Feature: template helpers | |
Scenario: As a template developer, I want to get a Route Reference to the current route | |
Given I am in any Twig template | |
And I am in the master request | |
When I use "{{ set route_reference = route_ref() }}" | |
Then "route_reference" contains a Route Reference to the current route | |
Scenario: As a template developer, I want to get a Route Reference to a location | |
Given I am in any Twig template | |
And "location" is a valid Location | |
When I use "{{ set route_reference = route_ref( location ) }}" | |
Then "root_reference" contains a Route Reference to "ez_content:view Location" for "location" | |
Scenario: As a template developer, I want to get a link to a Route Reference | |
Given I am in any Twig template | |
And "route_reference" is a valid Route Reference | |
When I use "{{ set path = path( route_reference ) }}" | |
Then "path" contains the href for the Route Reference | |
Scenario: As a template developer, I want to get a link to a Route Reference in a different language | |
Given I am in any Twig template | |
And "route_reference" is a valid Route Reference | |
When I use "{{ set path = path( route_reference.set( lang, 'fre-FR' ) }}" | |
Then "path" contains the href for the Route Reference in "fre-FR" | |
Scenario: As a template developer, I can't get a link to the current route from a subrequest | |
Given I am in any Twig template | |
And I am in a sub request | |
When I use "{{ route_ref() }}" | |
Then I expect an exception to be thrown |
wouterj
commented
Apr 26, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment