@@ -10,92 +10,92 @@ describe('ngPluralize', function() {
10
10
11
11
12
12
describe ( 'deal with pluralized strings without offset' , function ( ) {
13
- beforeEach ( inject ( function ( $rootScope , $compile ) {
14
- element = $compile (
13
+ beforeEach ( inject ( function ( $rootScope , $compile ) {
14
+ element = $compile (
15
15
'<ng:pluralize count="email"' +
16
16
"when=\"{'0': 'You have no new email'," +
17
17
"'one': 'You have one new email'," +
18
18
"'other': 'You have {} new emails'}\">" +
19
19
'</ng:pluralize>' ) ( $rootScope ) ;
20
- } ) ) ;
20
+ } ) ) ;
21
21
22
22
23
- it ( 'should show single/plural strings' , inject ( function ( $rootScope ) {
24
- $rootScope . email = 0 ;
25
- $rootScope . $digest ( ) ;
26
- expect ( element . text ( ) ) . toBe ( 'You have no new email' ) ;
23
+ it ( 'should show single/plural strings' , inject ( function ( $rootScope ) {
24
+ $rootScope . email = 0 ;
25
+ $rootScope . $digest ( ) ;
26
+ expect ( element . text ( ) ) . toBe ( 'You have no new email' ) ;
27
27
28
- $rootScope . email = '0' ;
29
- $rootScope . $digest ( ) ;
30
- expect ( element . text ( ) ) . toBe ( 'You have no new email' ) ;
28
+ $rootScope . email = '0' ;
29
+ $rootScope . $digest ( ) ;
30
+ expect ( element . text ( ) ) . toBe ( 'You have no new email' ) ;
31
31
32
- $rootScope . email = 1 ;
33
- $rootScope . $digest ( ) ;
34
- expect ( element . text ( ) ) . toBe ( 'You have one new email' ) ;
32
+ $rootScope . email = 1 ;
33
+ $rootScope . $digest ( ) ;
34
+ expect ( element . text ( ) ) . toBe ( 'You have one new email' ) ;
35
35
36
- $rootScope . email = 0.01 ;
37
- $rootScope . $digest ( ) ;
38
- expect ( element . text ( ) ) . toBe ( 'You have 0.01 new emails' ) ;
36
+ $rootScope . email = 0.01 ;
37
+ $rootScope . $digest ( ) ;
38
+ expect ( element . text ( ) ) . toBe ( 'You have 0.01 new emails' ) ;
39
39
40
- $rootScope . email = '0.1' ;
41
- $rootScope . $digest ( ) ;
42
- expect ( element . text ( ) ) . toBe ( 'You have 0.1 new emails' ) ;
40
+ $rootScope . email = '0.1' ;
41
+ $rootScope . $digest ( ) ;
42
+ expect ( element . text ( ) ) . toBe ( 'You have 0.1 new emails' ) ;
43
43
44
- $rootScope . email = 2 ;
45
- $rootScope . $digest ( ) ;
46
- expect ( element . text ( ) ) . toBe ( 'You have 2 new emails' ) ;
44
+ $rootScope . email = 2 ;
45
+ $rootScope . $digest ( ) ;
46
+ expect ( element . text ( ) ) . toBe ( 'You have 2 new emails' ) ;
47
47
48
- $rootScope . email = - 0.1 ;
49
- $rootScope . $digest ( ) ;
50
- expect ( element . text ( ) ) . toBe ( 'You have -0.1 new emails' ) ;
48
+ $rootScope . email = - 0.1 ;
49
+ $rootScope . $digest ( ) ;
50
+ expect ( element . text ( ) ) . toBe ( 'You have -0.1 new emails' ) ;
51
51
52
- $rootScope . email = '-0.01' ;
53
- $rootScope . $digest ( ) ;
54
- expect ( element . text ( ) ) . toBe ( 'You have -0.01 new emails' ) ;
52
+ $rootScope . email = '-0.01' ;
53
+ $rootScope . $digest ( ) ;
54
+ expect ( element . text ( ) ) . toBe ( 'You have -0.01 new emails' ) ;
55
55
56
- $rootScope . email = - 2 ;
57
- $rootScope . $digest ( ) ;
58
- expect ( element . text ( ) ) . toBe ( 'You have -2 new emails' ) ;
59
- } ) ) ;
56
+ $rootScope . email = - 2 ;
57
+ $rootScope . $digest ( ) ;
58
+ expect ( element . text ( ) ) . toBe ( 'You have -2 new emails' ) ;
59
+ } ) ) ;
60
60
61
61
62
- it ( 'should show single/plural strings with mal-formed inputs' , inject ( function ( $rootScope ) {
63
- $rootScope . email = '' ;
64
- $rootScope . $digest ( ) ;
65
- expect ( element . text ( ) ) . toBe ( '' ) ;
62
+ it ( 'should show single/plural strings with mal-formed inputs' , inject ( function ( $rootScope ) {
63
+ $rootScope . email = '' ;
64
+ $rootScope . $digest ( ) ;
65
+ expect ( element . text ( ) ) . toBe ( '' ) ;
66
66
67
- $rootScope . email = null ;
68
- $rootScope . $digest ( ) ;
69
- expect ( element . text ( ) ) . toBe ( '' ) ;
67
+ $rootScope . email = null ;
68
+ $rootScope . $digest ( ) ;
69
+ expect ( element . text ( ) ) . toBe ( '' ) ;
70
70
71
- $rootScope . email = undefined ;
72
- $rootScope . $digest ( ) ;
73
- expect ( element . text ( ) ) . toBe ( '' ) ;
71
+ $rootScope . email = undefined ;
72
+ $rootScope . $digest ( ) ;
73
+ expect ( element . text ( ) ) . toBe ( '' ) ;
74
74
75
- $rootScope . email = 'a3' ;
76
- $rootScope . $digest ( ) ;
77
- expect ( element . text ( ) ) . toBe ( '' ) ;
75
+ $rootScope . email = 'a3' ;
76
+ $rootScope . $digest ( ) ;
77
+ expect ( element . text ( ) ) . toBe ( '' ) ;
78
78
79
- $rootScope . email = '011' ;
80
- $rootScope . $digest ( ) ;
81
- expect ( element . text ( ) ) . toBe ( 'You have 11 new emails' ) ;
79
+ $rootScope . email = '011' ;
80
+ $rootScope . $digest ( ) ;
81
+ expect ( element . text ( ) ) . toBe ( 'You have 11 new emails' ) ;
82
82
83
- $rootScope . email = '-011' ;
84
- $rootScope . $digest ( ) ;
85
- expect ( element . text ( ) ) . toBe ( 'You have -11 new emails' ) ;
83
+ $rootScope . email = '-011' ;
84
+ $rootScope . $digest ( ) ;
85
+ expect ( element . text ( ) ) . toBe ( 'You have -11 new emails' ) ;
86
86
87
- $rootScope . email = '1fff' ;
88
- $rootScope . $digest ( ) ;
89
- expect ( element . text ( ) ) . toBe ( 'You have one new email' ) ;
87
+ $rootScope . email = '1fff' ;
88
+ $rootScope . $digest ( ) ;
89
+ expect ( element . text ( ) ) . toBe ( 'You have one new email' ) ;
90
90
91
- $rootScope . email = '0aa22' ;
92
- $rootScope . $digest ( ) ;
93
- expect ( element . text ( ) ) . toBe ( 'You have no new email' ) ;
91
+ $rootScope . email = '0aa22' ;
92
+ $rootScope . $digest ( ) ;
93
+ expect ( element . text ( ) ) . toBe ( 'You have no new email' ) ;
94
94
95
- $rootScope . email = '000001' ;
96
- $rootScope . $digest ( ) ;
97
- expect ( element . text ( ) ) . toBe ( 'You have one new email' ) ;
98
- } ) ) ;
95
+ $rootScope . email = '000001' ;
96
+ $rootScope . $digest ( ) ;
97
+ expect ( element . text ( ) ) . toBe ( 'You have one new email' ) ;
98
+ } ) ) ;
99
99
} ) ;
100
100
101
101
0 commit comments