attrtastic 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/attrtastic.gemspec +1 -1
- data/lib/attrtastic.rb +3 -0
- data/test/test_attributes.rb +18 -18
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/attrtastic.gemspec
CHANGED
data/lib/attrtastic.rb
CHANGED
@@ -198,6 +198,9 @@ module Attrtastic
|
|
198
198
|
end
|
199
199
|
|
200
200
|
[*for_value].each do |value|
|
201
|
+
value_options = options.clone
|
202
|
+
value_options[:html][:class] = [ options[:html][:class], value.class.to_s.underscore ].compact.join(" ")
|
203
|
+
|
201
204
|
attributes_for(value, args, options, &block)
|
202
205
|
end
|
203
206
|
end
|
data/test/test_attributes.rb
CHANGED
@@ -151,7 +151,7 @@ class TestAttributes < Test::Unit::TestCase
|
|
151
151
|
end
|
152
152
|
|
153
153
|
expected = html <<-EOHTML
|
154
|
-
<div class="attributes">
|
154
|
+
<div class="attributes user">
|
155
155
|
<ol>
|
156
156
|
</ol>
|
157
157
|
</div>
|
@@ -166,7 +166,7 @@ class TestAttributes < Test::Unit::TestCase
|
|
166
166
|
end
|
167
167
|
|
168
168
|
expected = html <<-EOHTML
|
169
|
-
<div class="attributes">
|
169
|
+
<div class="attributes user">
|
170
170
|
<div class="legend">Author</div>
|
171
171
|
<ol>
|
172
172
|
</ol>
|
@@ -179,7 +179,7 @@ class TestAttributes < Test::Unit::TestCase
|
|
179
179
|
|
180
180
|
should "work with field list" do
|
181
181
|
expected = html <<-EOHTML
|
182
|
-
<div class="attributes">
|
182
|
+
<div class="attributes user">
|
183
183
|
<ol>
|
184
184
|
<li class="attribute">
|
185
185
|
<span class="label">Full name</span>
|
@@ -222,7 +222,7 @@ class TestAttributes < Test::Unit::TestCase
|
|
222
222
|
end
|
223
223
|
|
224
224
|
expected = html <<-EOHTML
|
225
|
-
<div class="attributes">
|
225
|
+
<div class="attributes user">
|
226
226
|
<ol>
|
227
227
|
</ol>
|
228
228
|
</div>
|
@@ -237,7 +237,7 @@ class TestAttributes < Test::Unit::TestCase
|
|
237
237
|
end
|
238
238
|
|
239
239
|
expected = html <<-EOHTML
|
240
|
-
<div class="attributes">
|
240
|
+
<div class="attributes user">
|
241
241
|
<div class="legend">Author</div>
|
242
242
|
<ol>
|
243
243
|
</ol>
|
@@ -250,7 +250,7 @@ class TestAttributes < Test::Unit::TestCase
|
|
250
250
|
|
251
251
|
should "work with field list" do
|
252
252
|
expected = html <<-EOHTML
|
253
|
-
<div class="attributes">
|
253
|
+
<div class="attributes user">
|
254
254
|
<ol>
|
255
255
|
<li class="attribute">
|
256
256
|
<span class="label">Full name</span>
|
@@ -286,11 +286,11 @@ class TestAttributes < Test::Unit::TestCase
|
|
286
286
|
end
|
287
287
|
|
288
288
|
expected = html <<-EOHTML
|
289
|
-
<div class="attributes">
|
289
|
+
<div class="attributes post">
|
290
290
|
<ol>
|
291
291
|
</ol>
|
292
292
|
</div>
|
293
|
-
<div class="attributes">
|
293
|
+
<div class="attributes post">
|
294
294
|
<ol>
|
295
295
|
</ol>
|
296
296
|
</div>
|
@@ -305,12 +305,12 @@ class TestAttributes < Test::Unit::TestCase
|
|
305
305
|
end
|
306
306
|
|
307
307
|
expected = html <<-EOHTML
|
308
|
-
<div class="attributes">
|
308
|
+
<div class="attributes post">
|
309
309
|
<div class="legend">Post</div>
|
310
310
|
<ol>
|
311
311
|
</ol>
|
312
312
|
</div>
|
313
|
-
<div class="attributes">
|
313
|
+
<div class="attributes post">
|
314
314
|
<div class="legend">Post</div>
|
315
315
|
<ol>
|
316
316
|
</ol>
|
@@ -323,7 +323,7 @@ class TestAttributes < Test::Unit::TestCase
|
|
323
323
|
|
324
324
|
should "work with field list" do
|
325
325
|
expected = html <<-EOHTML
|
326
|
-
<div class="attributes">
|
326
|
+
<div class="attributes post">
|
327
327
|
<ol>
|
328
328
|
<li class="attribute">
|
329
329
|
<span class="label">Title</span>
|
@@ -331,7 +331,7 @@ class TestAttributes < Test::Unit::TestCase
|
|
331
331
|
</li>
|
332
332
|
</ol>
|
333
333
|
</div>
|
334
|
-
<div class="attributes">
|
334
|
+
<div class="attributes post">
|
335
335
|
<ol>
|
336
336
|
<li class="attribute">
|
337
337
|
<span class="label">Title</span>
|
@@ -367,11 +367,11 @@ class TestAttributes < Test::Unit::TestCase
|
|
367
367
|
end
|
368
368
|
|
369
369
|
expected = html <<-EOHTML
|
370
|
-
<div class="attributes">
|
370
|
+
<div class="attributes post">
|
371
371
|
<ol>
|
372
372
|
</ol>
|
373
373
|
</div>
|
374
|
-
<div class="attributes">
|
374
|
+
<div class="attributes post">
|
375
375
|
<ol>
|
376
376
|
</ol>
|
377
377
|
</div>
|
@@ -386,12 +386,12 @@ class TestAttributes < Test::Unit::TestCase
|
|
386
386
|
end
|
387
387
|
|
388
388
|
expected = html <<-EOHTML
|
389
|
-
<div class="attributes">
|
389
|
+
<div class="attributes post">
|
390
390
|
<div class="legend">Post</div>
|
391
391
|
<ol>
|
392
392
|
</ol>
|
393
393
|
</div>
|
394
|
-
<div class="attributes">
|
394
|
+
<div class="attributes post">
|
395
395
|
<div class="legend">Post</div>
|
396
396
|
<ol>
|
397
397
|
</ol>
|
@@ -404,7 +404,7 @@ class TestAttributes < Test::Unit::TestCase
|
|
404
404
|
|
405
405
|
should "work with field list" do
|
406
406
|
expected = html <<-EOHTML
|
407
|
-
<div class="attributes">
|
407
|
+
<div class="attributes post">
|
408
408
|
<ol>
|
409
409
|
<li class="attribute">
|
410
410
|
<span class="label">Title</span>
|
@@ -412,7 +412,7 @@ class TestAttributes < Test::Unit::TestCase
|
|
412
412
|
</li>
|
413
413
|
</ol>
|
414
414
|
</div>
|
415
|
-
<div class="attributes">
|
415
|
+
<div class="attributes post">
|
416
416
|
<ol>
|
417
417
|
<li class="attribute">
|
418
418
|
<span class="label">Title</span>
|