3
3
class CountryTest < ActiveSupport ::TestCase
4
4
def test_community_name_fallback
5
5
# If there is no translations and no name for the chapter, use the community name
6
- community = Community . new ( { "id" => "foo-chapter" , "type" => "osm-lc" , "strings" => { "community" => "Community Name" } } )
6
+ community = CommunityIndex . new ( { "id" => "foo-chapter" , "type" => "osm-lc" , "strings" => { "community" => "Community Name" } } )
7
7
community_locale_yaml = { }
8
8
9
9
name = OsmCommunityIndex . resolve_name ( community , community_locale_yaml )
@@ -12,7 +12,7 @@ def test_community_name_fallback
12
12
13
13
def test_resource_name_fallback
14
14
# If there is a name for the chapter, prefer that to the community name
15
- community = Community . new ( { "id" => "foo-chapter" , "type" => "osm-lc" , "strings" => { "community" => "Community Name" , "name" => "Chapter Name" } } )
15
+ community = CommunityIndex . new ( { "id" => "foo-chapter" , "type" => "osm-lc" , "strings" => { "community" => "Community Name" , "name" => "Chapter Name" } } )
16
16
community_locale_yaml = { }
17
17
18
18
name = OsmCommunityIndex . resolve_name ( community , community_locale_yaml )
@@ -21,7 +21,7 @@ def test_resource_name_fallback
21
21
22
22
def test_i18n_explicit_name
23
23
# If there is an explicitly translated name for the chapter, use that
24
- community = Community . new ( { "id" => "foo-chapter" , "type" => "osm-lc" , "strings" => { "community" => "Community Name" , "name" => "Chapter Name" } } )
24
+ community = CommunityIndex . new ( { "id" => "foo-chapter" , "type" => "osm-lc" , "strings" => { "community" => "Community Name" , "name" => "Chapter Name" } } )
25
25
community_locale_yaml = { "foo-chapter" => { "name" => "Translated Chapter Name" } }
26
26
27
27
name = OsmCommunityIndex . resolve_name ( community , community_locale_yaml )
@@ -30,7 +30,7 @@ def test_i18n_explicit_name
30
30
31
31
def test_i18n_fallback_name
32
32
# If there's no explicitly translated name for the chapter, use the default name and interpolate the community name if required.
33
- community = Community . new ( { "id" => "foo-chapter" , "type" => "osm-lc" , "strings" => { "community" => "Community Name" , "communityID" => "communityname" } } )
33
+ community = CommunityIndex . new ( { "id" => "foo-chapter" , "type" => "osm-lc" , "strings" => { "community" => "Community Name" , "communityID" => "communityname" } } )
34
34
community_locale_yaml = { "_communities" => { "communityname" => "Translated Community" } , "_defaults" => { "osm-lc" => { "name" => "{community} Chapter" } } }
35
35
36
36
name = OsmCommunityIndex . resolve_name ( community , community_locale_yaml )
0 commit comments