Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can provide additional attributes, via hash (as a 3rd argument) Link can now be passed an absolute url
- Loading branch information
Dougal MacPherson
committed
Sep 18, 2013
1 parent
d058d6b
commit 23c675c
Showing
3 changed files
with
101 additions
and
6 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,43 @@ | ||
Feature: link method with attributes | ||
|
||
I want to be able to pass arguments to the link method | ||
So that additional attributes are generated | ||
|
||
Scenario: link with class attribute | ||
|
||
Given input file "index.html.haml" contains | ||
""" | ||
= link("page.html", "Page", :class => 'active') | ||
""" | ||
And input file "page.html" exists | ||
|
||
When I build the site | ||
Then output file "index.html" should contain | ||
""" | ||
<a class="active" href="page.html">Page</a> | ||
""" | ||
|
||
Scenario: link with title attribute | ||
|
||
Given input file "index.html.haml" contains | ||
""" | ||
= link("page.html", "Page", :title => 'click me') | ||
""" | ||
And input file "page.html" exists | ||
|
||
When I build the site | ||
Then output file "index.html" should contain | ||
""" | ||
<a title="click me" href="page.html">Page</a> | ||
""" | ||
|
||
Scenario: link with title and class attributes | ||
|
||
Given input file "index.html.haml" contains | ||
""" | ||
= link("page.html", "Page", :title => 'click me', :class => 'active') | ||
""" | ||
And input file "page.html" exists | ||
|
||
When I build the site | ||
Then output file "index.html" should contain /<a [title="click me", class="active", href="page.html"]/ |
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