summaryrefslogtreecommitdiff
path: root/test/models/helpers/nodes_helper_test.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-13 23:33:11 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-13 23:33:11 +0200
commit8eab68f2c5a3c126e2fec2ecdfa7ace87ce0937b (patch)
treef446ebc26a7707c7b64a937aa51a155df146c80a /test/models/helpers/nodes_helper_test.rb
parent42714c697273a7117c6b355fab26c8c35e336ad1 (diff)
parentcdf5d9941ca866d437612d2f863eac6eb0b3db12 (diff)
Merge branch 'erdgeist-revive-events'
Diffstat (limited to 'test/models/helpers/nodes_helper_test.rb')
-rw-r--r--test/models/helpers/nodes_helper_test.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/models/helpers/nodes_helper_test.rb b/test/models/helpers/nodes_helper_test.rb
index 13011de..5ab924f 100644
--- a/test/models/helpers/nodes_helper_test.rb
+++ b/test/models/helpers/nodes_helper_test.rb
@@ -1,4 +1,36 @@
1require 'test_helper' 1require 'test_helper'
2 2
3class NodesHelperTest < ActionView::TestCase 3class NodesHelperTest < ActionView::TestCase
4 FakePage = Struct.new(:tag_list)
5
6 test "default_event_tag_mapping matches erfa-detail" do
7 page = FakePage.new(["erfa-detail"])
8 assert_equal ["erfa-detail", "open-day"], default_event_tag_mapping(page)
9 end
10
11 test "default_event_tag_mapping matches chaostreff-detail" do
12 page = FakePage.new(["chaostreff-detail"])
13 assert_equal ["chaostreff-detail", "open-day"], default_event_tag_mapping(page)
14 end
15
16 test "default_event_tag_mapping returns nil for unrelated tags" do
17 page = FakePage.new(["update"])
18 assert_nil default_event_tag_mapping(page)
19 end
20
21 test "default_event_tag_list is nil without a matching tag" do
22 page = FakePage.new([])
23 assert_nil default_event_tag_list(page)
24 end
25
26 test "sitemap_node_open? is false for a configured collapsed path" do
27 club = Node.root.children.create!(:slug => "club")
28 erfas = club.children.create!(:slug => "erfas")
29 assert_equal false, sitemap_node_open?(erfas)
30 end
31
32 test "sitemap_node_open? is true for anything not configured as collapsed" do
33 node = Node.root.children.create!(:slug => "sitemap_open_test")
34 assert_equal true, sitemap_node_open?(node)
35 end
4end 36end