blob: 5ab924fd15f9cdd8824f64ef57c310b9b71d35af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
require 'test_helper'
class NodesHelperTest < ActionView::TestCase
FakePage = Struct.new(:tag_list)
test "default_event_tag_mapping matches erfa-detail" do
page = FakePage.new(["erfa-detail"])
assert_equal ["erfa-detail", "open-day"], default_event_tag_mapping(page)
end
test "default_event_tag_mapping matches chaostreff-detail" do
page = FakePage.new(["chaostreff-detail"])
assert_equal ["chaostreff-detail", "open-day"], default_event_tag_mapping(page)
end
test "default_event_tag_mapping returns nil for unrelated tags" do
page = FakePage.new(["update"])
assert_nil default_event_tag_mapping(page)
end
test "default_event_tag_list is nil without a matching tag" do
page = FakePage.new([])
assert_nil default_event_tag_list(page)
end
test "sitemap_node_open? is false for a configured collapsed path" do
club = Node.root.children.create!(:slug => "club")
erfas = club.children.create!(:slug => "erfas")
assert_equal false, sitemap_node_open?(erfas)
end
test "sitemap_node_open? is true for anything not configured as collapsed" do
node = Node.root.children.create!(:slug => "sitemap_open_test")
assert_equal true, sitemap_node_open?(node)
end
end
|