Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
b080ad14
Commit
b080ad14
authored
Dec 26, 2011
by
Holger Just
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#790] Test the lazy variables
parent
f1324e6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
liquid_test.rb
test/unit/lib/chili_project/liquid_test.rb
+14
-2
No files found.
test/unit/lib/chili_project/liquid_test.rb
View file @
b080ad14
...
...
@@ -23,14 +23,26 @@ class ChiliProject::LiquidTest < ActionView::TestCase
end
end
context
"variable
_list tag
"
do
context
"variable
s
"
do
should
"render a list of the current variables"
do
text
=
"{
% variable_list %
}"
text
=
"{
{ variables | to_list }
}"
formatted
=
textilizable
(
text
)
assert
formatted
.
include?
(
'<ul>'
),
"Not in a list format"
assert
formatted
.
include?
(
'current_user'
)
end
should
"be lazily evaluated"
do
text
=
[
"{{ variables | to_list }}"
]
text
<<
'{% assign foo = \"bar\" %}'
text
<<
"{{ variables | to_list }}"
formatted
=
textilizable
(
text
.
join
(
"
\n
"
))
assert
(
formatted
.
scan
(
'<ul>'
).
size
==
2
),
"Not in a list format"
assert
(
formatted
.
scan
(
'current_user'
).
size
==
2
)
assert
(
formatted
.
scan
(
'foo'
).
size
==
1
),
"Not updated on added variable"
end
end
context
"child_pages tag"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment