hooch 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hooch/hooch_helper.rb +3 -2
- data/lib/hooch/version.rb +1 -1
- data/test/dummy/log/test.log +142 -0
- data/test/hooch_helper_test.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 002b7bee6d4c11657c26debfd758de362ce9b194
|
4
|
+
data.tar.gz: 51d382d86ef88967ff0fd936f7fd875d756da746
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 930d09541fec97440ed5aa61397bfb74765f7d33f8b985f0f96ba91ddcfcd2e948e6d7ac01daa0b9d6f86e53918bb174d2942dc07cd6bc4ae5364d5340f2e723
|
7
|
+
data.tar.gz: 8b540736e14bd6859578b2902906ecb4edda0dd1e25c8bf62ac2c18e9e8c8ef52d758f8fa02ab58f3af65a0b2bc78ca7c8b982d81c4da15fcbefdba5615f8033
|
data/lib/hooch/hooch_helper.rb
CHANGED
@@ -20,9 +20,10 @@ module Hooch
|
|
20
20
|
attrs = 'data-tab-id=' + id
|
21
21
|
end
|
22
22
|
|
23
|
-
def expander(id, expand_class: nil)
|
23
|
+
def expander(id, expand_class: nil, collapse_class: nil)
|
24
24
|
attrs = "data-expander=true data-expand-id=" + id
|
25
|
-
attrs += "data-expand-class=" + expand_class if expand_class.present?
|
25
|
+
attrs += " data-expand-class=" + expand_class if expand_class.present?
|
26
|
+
attrs += " data-collapse-class=" + collapse_class if collapse_class.present?
|
26
27
|
attrs
|
27
28
|
end
|
28
29
|
|
data/lib/hooch/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -1414,5 +1414,147 @@ HoochHelperTest: test_0025_generates prevent_double_click attrs
|
|
1414
1414
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1415
1415
|
----------------------------------------------------------------
|
1416
1416
|
HoochHelperTest: test_0026_generates prevent_double_click params
|
1417
|
+
----------------------------------------------------------------
|
1418
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1419
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1420
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
1421
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
1422
|
+
[1m[36m (0.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1423
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1424
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
1425
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1426
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1427
|
+
-------------------------------------------------------
|
1428
|
+
HoochHelperTest: test_0001_generates tab set attributes
|
1429
|
+
-------------------------------------------------------
|
1430
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1431
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1432
|
+
-------------------------------------------------------
|
1433
|
+
HoochHelperTest: test_0002_generates ajax tab set attrs
|
1434
|
+
-------------------------------------------------------
|
1435
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1436
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1437
|
+
-----------------------------------------------------------------
|
1438
|
+
HoochHelperTest: test_0003_generates tab set attrs with a default
|
1439
|
+
-----------------------------------------------------------------
|
1440
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1441
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1442
|
+
------------------------------------------------------
|
1443
|
+
HoochHelperTest: test_0004_generates tab trigger attrs
|
1444
|
+
------------------------------------------------------
|
1445
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1446
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1447
|
+
----------------------------------------------------------------------
|
1448
|
+
HoochHelperTest: test_0005_generates tab trigger attrs with push state
|
1449
|
+
----------------------------------------------------------------------
|
1450
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1451
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1452
|
+
------------------------------------------------------
|
1453
|
+
HoochHelperTest: test_0006_generates tab_content attrs
|
1454
|
+
------------------------------------------------------
|
1455
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1456
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1457
|
+
---------------------------------------------------
|
1458
|
+
HoochHelperTest: test_0007_generates expander attrs
|
1459
|
+
---------------------------------------------------
|
1460
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1461
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1462
|
+
----------------------------------------------------------------
|
1463
|
+
HoochHelperTest: test_0008_generates expander attrs with classes
|
1464
|
+
----------------------------------------------------------------
|
1465
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1466
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1467
|
+
----------------------------------------------------
|
1468
|
+
HoochHelperTest: test_0009_generates collapser attrs
|
1469
|
+
----------------------------------------------------
|
1470
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1471
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
1472
|
+
----------------------------------------------------
|
1473
|
+
HoochHelperTest: test_0010_generates collapsed attrs
|
1474
|
+
----------------------------------------------------
|
1475
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1476
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1477
|
+
---------------------------------------------------
|
1478
|
+
HoochHelperTest: test_0011_generates expanded attrs
|
1479
|
+
---------------------------------------------------
|
1480
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1481
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1482
|
+
--------------------------------------------------
|
1483
|
+
HoochHelperTest: test_0012_generates emptier attrs
|
1484
|
+
--------------------------------------------------
|
1485
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1486
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1487
|
+
--------------------------------------------------
|
1488
|
+
HoochHelperTest: test_0013_generates remover attrs
|
1489
|
+
--------------------------------------------------
|
1490
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1491
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1492
|
+
---------------------------------------------------
|
1493
|
+
HoochHelperTest: test_0014_generates revealer attrs
|
1494
|
+
---------------------------------------------------
|
1495
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1496
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1497
|
+
----------------------------------------------------
|
1498
|
+
HoochHelperTest: test_0015_generates a revealer hash
|
1499
|
+
----------------------------------------------------
|
1500
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1501
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1502
|
+
------------------------------------------------------
|
1503
|
+
HoochHelperTest: test_0016_generates click proxy attrs
|
1504
|
+
------------------------------------------------------
|
1505
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1506
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1507
|
+
------------------------------------------------------------------
|
1508
|
+
HoochHelperTest: test_0017_generates click proxy attrs with target
|
1509
|
+
------------------------------------------------------------------
|
1510
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1511
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1512
|
+
-----------------------------------------------------
|
1513
|
+
HoochHelperTest: test_0018_generates click proxy hash
|
1514
|
+
-----------------------------------------------------
|
1515
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1516
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1517
|
+
-------------------------------------------------------
|
1518
|
+
HoochHelperTest: test_0019_generates submit proxy attrs
|
1519
|
+
-------------------------------------------------------
|
1520
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1521
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1522
|
+
--------------------------------------------------------
|
1523
|
+
HoochHelperTest: test_0020_generates submit proxy params
|
1524
|
+
--------------------------------------------------------
|
1525
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1526
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1527
|
+
-------------------------------------------------------
|
1528
|
+
HoochHelperTest: test_0021_generates field filler attrs
|
1529
|
+
-------------------------------------------------------
|
1530
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1531
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1532
|
+
--------------------------------------------------------
|
1533
|
+
HoochHelperTest: test_0022_generates field filler params
|
1534
|
+
--------------------------------------------------------
|
1535
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1536
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1537
|
+
-----------------------------------------------
|
1538
|
+
HoochHelperTest: test_0023_generates link attrs
|
1539
|
+
-----------------------------------------------
|
1540
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1541
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1542
|
+
----------------------------------------------------------------
|
1543
|
+
HoochHelperTest: test_0024_generates prevent double submit attrs
|
1544
|
+
----------------------------------------------------------------
|
1545
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1546
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1547
|
+
-----------------------------------------------------------------
|
1548
|
+
HoochHelperTest: test_0025_generates prevent_double_submit params
|
1549
|
+
-----------------------------------------------------------------
|
1550
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1551
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1552
|
+
---------------------------------------------------------------
|
1553
|
+
HoochHelperTest: test_0026_generates prevent_double_click attrs
|
1554
|
+
---------------------------------------------------------------
|
1555
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1556
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1557
|
+
----------------------------------------------------------------
|
1558
|
+
HoochHelperTest: test_0027_generates prevent_double_click params
|
1417
1559
|
----------------------------------------------------------------
|
1418
1560
|
[1m[35m (0.0ms)[0m rollback transaction
|
data/test/hooch_helper_test.rb
CHANGED
@@ -38,6 +38,11 @@ class HoochHelperTest < ActionView::TestCase
|
|
38
38
|
attrs.must_equal "data-expander=true data-expand-id=see_more"
|
39
39
|
end
|
40
40
|
|
41
|
+
it "generates expander attrs with classes" do
|
42
|
+
attrs = expander('see_more', expand_class: 'expanded', collapse_class: 'collapsed')
|
43
|
+
attrs.must_equal "data-expander=true data-expand-id=see_more data-expand-class=expanded data-collapse-class=collapsed"
|
44
|
+
end
|
45
|
+
|
41
46
|
it "generates collapser attrs" do
|
42
47
|
attrs = collapser('see_less')
|
43
48
|
attrs.must_equal "data-collapser=true data-expand-id=see_less"
|