diff options
Diffstat (limited to 'test/models/helpers')
| -rw-r--r-- | test/models/helpers/content_helper_test.rb | 4 | ||||
| -rw-r--r-- | test/models/helpers/nodes_helper_test.rb | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/models/helpers/content_helper_test.rb b/test/models/helpers/content_helper_test.rb index 2da82d7e..a7ed478d 100644 --- a/test/models/helpers/content_helper_test.rb +++ b/test/models/helpers/content_helper_test.rb | |||
| @@ -1,4 +1,8 @@ | |||
| 1 | require 'test_helper' | 1 | require 'test_helper' |
| 2 | 2 | ||
| 3 | class ContentHelperTest < ActionView::TestCase | 3 | class ContentHelperTest < ActionView::TestCase |
| 4 | test "weekday_abbr delegates through the current I18n locale" do | ||
| 5 | I18n.locale = :de | ||
| 6 | assert_equal "Mo", weekday_abbr(Time.parse("2026-07-06")) | ||
| 7 | end | ||
| 4 | end | 8 | end |
diff --git a/test/models/helpers/nodes_helper_test.rb b/test/models/helpers/nodes_helper_test.rb index 13011dea..5d91a885 100644 --- a/test/models/helpers/nodes_helper_test.rb +++ b/test/models/helpers/nodes_helper_test.rb | |||
| @@ -1,4 +1,25 @@ | |||
| 1 | require 'test_helper' | 1 | require 'test_helper' |
| 2 | 2 | ||
| 3 | class NodesHelperTest < ActionView::TestCase | 3 | class 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 | ||
| 4 | end | 25 | end |
