nutmeg 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nutmeg/tag_tree_helper.rb +1 -3
- data/lib/nutmeg/version.rb +1 -1
- data/spec/tag_tree_helper_spec.rb +8 -1
- 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: 123b62c1b70f93ad02f00b754a735d2cab3e9e74
|
4
|
+
data.tar.gz: 7f189ebe9a2a44b3634b16b5874b7387c2466ed2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 489de4a4be48f792cee9a68efdacb700bbd86c808a8d8eb6b8b22fabcdcec068aead0d045ebe1e462d67873c94f7853c1e1aadeb18f051886ed25032b83dac4f
|
7
|
+
data.tar.gz: f8d6f1f8845d61d8308446eb977a203f27870bc8fe4a26af16958ecd8c26636c91c071b808a251f8c131f8dbfc9756085efb52ce75359b3d6a2da5714ae3713c
|
data/lib/nutmeg/version.rb
CHANGED
@@ -9,7 +9,14 @@ describe Nutmeg::TagTreeHelper do
|
|
9
9
|
describe "#print_html" do
|
10
10
|
it "outputs html" do
|
11
11
|
expect(Nutmeg::TagTreeHelper.new(@tree_from_yaml.tree).print_html([1]).class).to eq(String)
|
12
|
-
expect(Nutmeg::TagTreeHelper.new(@tree_from_yaml.tree).print_html(["north", "men", "collections", "summer_2015"])).to eq("<ul><li class='level_1 active'> <a >north</a><ul><li class='level_2 active'> <a >men</a><ul><li class='level_3 active'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/north/men/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/north/men/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf active'> <a href='/north/men/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_2'> <a >women</a><ul><li class='level_3'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/north/women/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/north/women/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf'> <a href='/north/women/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_2'> <a >events</a><ul><li class='level_3 leaf'> <a href='/north/events/lowlands_2014'>lowlands_2014</a></li><li class='level_3 leaf'> <a href='/north/events/sinterklaas_2014'>sinterklaas_2014</a></li></ul></li><li class='level_2'> <a >collaborations</a><ul><li class='level_3 leaf'> <a href='/north/collaborations/afro_jack'>afro_jack</a></li><li class='level_3 leaf'> <a href='/north/collaborations/pr_co'>pr_co</a></li></ul></li></ul></li><li class='level_1'> <a >south</a><ul></li></li></ul></li></ul>")
|
12
|
+
expect(Nutmeg::TagTreeHelper.new(@tree_from_yaml.tree).print_html(["north", "men", "collections", "summer_2015"])).to eq("<ul><li class='level_1 active'> <a >north</a><ul><li class='level_2 active'> <a >men</a><ul><li class='level_3 active'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/north/men/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/north/men/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf active'> <a href='/north/men/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_2'> <a >women</a><ul><li class='level_3'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/north/women/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/north/women/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf'> <a href='/north/women/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_2'> <a >events</a><ul><li class='level_3 leaf'> <a href='/north/events/lowlands_2014'>lowlands_2014</a></li><li class='level_3 leaf'> <a href='/north/events/sinterklaas_2014'>sinterklaas_2014</a></li></ul></li><li class='level_2'> <a >collaborations</a><ul><li class='level_3 leaf'> <a href='/north/collaborations/afro_jack'>afro_jack</a></li><li class='level_3 leaf'> <a href='/north/collaborations/pr_co'>pr_co</a></li></ul></li></ul></li><li class='level_1'> <a >south</a><ul><li class='level_2'> <a >men</a><ul><li class='level_3'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/south/men/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/south/men/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf'> <a href='/south/men/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_2'> <a >women</a><ul><li class='level_3'> <a >collections</a><ul><li class='level_4 leaf'> <a href='/south/women/collections/winter_2015'>winter_2015</a></li><li class='level_4 leaf'> <a href='/south/women/collections/spring_2015'>spring_2015</a></li><li class='level_4 leaf'> <a href='/south/women/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li></ul></li></ul>")
|
13
13
|
end
|
14
|
+
|
15
|
+
it "outputs html for subtree" do
|
16
|
+
subtree = @tree_from_yaml.tree.subtree("north")
|
17
|
+
expect(Nutmeg::TagTreeHelper.new(subtree).print_html(["men", "collections", "summer_2015"])).to eq("<ul><li class='level_1 active'> <a >men</a><ul><li class='level_2 active'> <a >collections</a><ul><li class='level_3 leaf'> <a href='/north/men/collections/winter_2015'>winter_2015</a></li><li class='level_3 leaf'> <a href='/north/men/collections/spring_2015'>spring_2015</a></li><li class='level_3 leaf active'> <a href='/north/men/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_1'> <a >women</a><ul><li class='level_2'> <a >collections</a><ul><li class='level_3 leaf'> <a href='/north/women/collections/winter_2015'>winter_2015</a></li><li class='level_3 leaf'> <a href='/north/women/collections/spring_2015'>spring_2015</a></li><li class='level_3 leaf'> <a href='/north/women/collections/summer_2015'>summer_2015</a></li></ul></li></ul></li><li class='level_1'> <a >events</a><ul><li class='level_2 leaf'> <a href='/north/events/lowlands_2014'>lowlands_2014</a></li><li class='level_2 leaf'> <a href='/north/events/sinterklaas_2014'>sinterklaas_2014</a></li></ul></li><li class='level_1'> <a >collaborations</a><ul><li class='level_2 leaf'> <a href='/north/collaborations/afro_jack'>afro_jack</a></li><li class='level_2 leaf'> <a href='/north/collaborations/pr_co'>pr_co</a></li></ul></li></ul>")
|
18
|
+
end
|
19
|
+
|
20
|
+
|
14
21
|
end
|
15
22
|
end
|