forked from belisarius222/Meteor-handlebar-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers_tests.html
99 lines (74 loc) · 2.04 KB
/
helpers_tests.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<template name="test_helpers_00">
Hi
</template>
<!-- Test getSession -->
<template name="test_helpers_10">
{{$.Session.get 'test'}}
</template>
<!-- Test $.Session.equals -->
<template name="test_helpers_20">
{{$.Session.equals 'test' 'sdfsdfdsf'}}
</template>
<template name="test_helpers_21">
{{$.Session.equals 'test' 1}}
</template>
<template name="test_helpers_22">
{{$.Session.equals 'test' '1'}}
</template>
<template name="test_helpers_23">
{{$.Session.equals 'test' ['a', 'b', 'c']}}
</template>
<!-- This still fails:
<template name="test_helpers_24">
{{$.Session.equals 'test' {foo: 'bar'} }}
</template> -->
<template name="test_helpers_24">
{{$.Session.equals 'test' value }}
</template>
<template name="test_helpers_25">
{{$.Session.equals 'test' true}}
</template>
<template name="test_helpers_26">
{{$.Session.equals 'test' false}}
</template>
<template name="test_helpers_27">
{{#if $.Session.equals 'test' false}}Test is false{{else}}Test is true{{/if}}
</template>
<!-- Test find -->
<template name="test_helpers_30">
{{findOne 'testCollection' '{}'}}
</template>
<template name="test_helpers_31">
{{find 'testCollection' '{}'}}
</template>
<template name="test_helpers_32">
{{#with findOne 'testCollection' '{}'}}ok{{/with}}
</template>
<template name="test_helpers_33">
{{#with findOne 'testCollection' '{}'}}{{a}}{{/with}}
</template>
<template name="test_helpers_34">
{{#each find 'testCollection' '{}'}}{{a}}{{else}}none{{/each}}
</template>
<!-- Test getText -->
<template name="test_helpers_40">
{{getText 'say.hello.to.me'}}
</template>
<template name="test_helpers_41">
{{getText 'Say.hello.to.me'}}
</template>
<template name="test_helpers_42">
{{getText 'Say.Hello.To.Me'}}
</template>
<template name="test_helpers_43">
{{getText 'SAY.HELLO.TO.ME'}}
</template>
<template name="test_helpers_44">
{{getText 'SAy.hello.to.me'}}
</template>
<template name="test_helpers_45">
{{getText 'this.is.not.found'}}
</template>
<template name="test_helpers_46">
{{getText 'foo.bar'}}
</template>