@@ -105,19 +105,19 @@ def test_is_active_link_array
105
105
def test_is_active_link_hash
106
106
params [ :a ] = 1
107
107
108
- assert is_active_link? ( '/' , { :a => 1 } )
109
- assert is_active_link? ( '/' , { :a => 1 , :b => nil } )
108
+ assert is_active_link? ( '/' , { a : 1 } )
109
+ assert is_active_link? ( '/' , { a : 1 , b : nil } )
110
110
111
- refute is_active_link? ( '/' , { :a => 1 , :b => 2 } )
112
- refute is_active_link? ( '/' , { :a => 2 } )
111
+ refute is_active_link? ( '/' , { a : 1 , b : 2 } )
112
+ refute is_active_link? ( '/' , { a : 2 } )
113
113
114
114
params [ :b ] = 2
115
115
116
- assert is_active_link? ( '/' , { :a => 1 , :b => 2 } )
117
- assert is_active_link? ( '/' , { :a => 1 , :b => 2 , :c => nil } )
116
+ assert is_active_link? ( '/' , { a : 1 , b : 2 } )
117
+ assert is_active_link? ( '/' , { a : 1 , b : 2 , c : nil } )
118
118
119
- assert is_active_link? ( '/' , { :a => 1 } )
120
- assert is_active_link? ( '/' , { :b => 2 } )
119
+ assert is_active_link? ( '/' , { a : 1 } )
120
+ assert is_active_link? ( '/' , { b : 2 } )
121
121
end
122
122
123
123
def test_is_active_link_with_memoization
@@ -131,10 +131,10 @@ def test_is_active_link_with_memoization
131
131
def test_active_link_to_class
132
132
set_fullpath ( '/root' )
133
133
assert_equal 'active' , active_link_to_class ( '/root' )
134
- assert_equal 'on' , active_link_to_class ( '/root' , : class_active => 'on' )
134
+ assert_equal 'on' , active_link_to_class ( '/root' , class_active : 'on' )
135
135
136
136
assert_equal '' , active_link_to_class ( '/other' )
137
- assert_equal 'off' , active_link_to_class ( '/other' , : class_inactive => 'off' )
137
+ assert_equal 'off' , active_link_to_class ( '/other' , class_inactive : 'off' )
138
138
end
139
139
140
140
def test_active_link_to
@@ -148,54 +148,54 @@ def test_active_link_to
148
148
149
149
def test_active_link_to_with_existing_class
150
150
set_fullpath ( '/root' )
151
- link = active_link_to ( 'label' , '/root' , : class => 'current' )
151
+ link = active_link_to ( 'label' , '/root' , class : 'current' )
152
152
assert_html link , 'a.current.active[href="/root"]' , 'label'
153
153
154
- link = active_link_to ( 'label' , '/other' , : class => 'current' )
154
+ link = active_link_to ( 'label' , '/other' , class : 'current' )
155
155
assert_html link , 'a.current[href="/other"]' , 'label'
156
156
end
157
157
158
158
def test_active_link_to_with_custom_classes
159
159
set_fullpath ( '/root' )
160
- link = active_link_to ( 'label' , '/root' , : class_active => 'on' )
160
+ link = active_link_to ( 'label' , '/root' , class_active : 'on' )
161
161
assert_html link , 'a.on[href="/root"]' , 'label'
162
162
163
- link = active_link_to ( 'label' , '/other' , : class_inactive => 'off' )
163
+ link = active_link_to ( 'label' , '/other' , class_inactive : 'off' )
164
164
assert_html link , 'a.off[href="/other"]' , 'label'
165
165
end
166
166
167
167
def test_active_link_to_with_wrap_tag
168
168
set_fullpath ( '/root' )
169
- link = active_link_to ( 'label' , '/root' , : wrap_tag => :li )
169
+ link = active_link_to ( 'label' , '/root' , wrap_tag : :li )
170
170
assert_html link , 'li.active a.active[href="/root"]' , 'label'
171
171
172
- link = active_link_to ( 'label' , '/root' , : wrap_tag => :li , : active_disable => true )
172
+ link = active_link_to ( 'label' , '/root' , wrap_tag : :li , active_disable : true )
173
173
assert_html link , 'li.active span.active' , 'label'
174
174
175
- link = active_link_to ( 'label' , '/root' , : wrap_tag => :li , : class => 'testing' )
175
+ link = active_link_to ( 'label' , '/root' , wrap_tag : :li , class : 'testing' )
176
176
assert_html link , 'li.testing.active a.testing.active[href="/root"]' , 'label'
177
177
end
178
178
179
179
def test_active_link_to_with_active_disable
180
180
set_fullpath ( '/root' )
181
- link = active_link_to ( 'label' , '/root' , : active_disable => true )
181
+ link = active_link_to ( 'label' , '/root' , active_disable : true )
182
182
assert_html link , 'span.active' , 'label'
183
183
end
184
184
185
185
def test_should_not_modify_passed_params
186
186
set_fullpath ( '/root' )
187
- params = { : class => 'testing' , : active => :inclusive }
187
+ params = { class : 'testing' , active : :inclusive }
188
188
out = active_link_to 'label' , '/root' , params
189
189
assert_html out , 'a.testing.active[href="/root"]' , 'label'
190
- assert_equal ( { : class => 'testing' , : active => :inclusive } ) , params
190
+ assert_equal ( { class : 'testing' , active : :inclusive } ) , params
191
191
end
192
192
193
193
def test_no_empty_class_attribute
194
194
set_fullpath ( '/root' )
195
- link = active_link_to ( 'label' , '/root' , : wrap_tag => :li )
195
+ link = active_link_to ( 'label' , '/root' , wrap_tag : :li )
196
196
assert_html link , 'li.active a.active[href="/root"]' , 'label'
197
197
198
- link = active_link_to ( 'label' , '/other' , : wrap_tag => :li )
198
+ link = active_link_to ( 'label' , '/other' , wrap_tag : :li )
199
199
assert_html link , 'li a[href="/other"]' , 'label'
200
200
end
201
201
0 commit comments