zedlocales 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/test/helper.rb +2 -2
- data/test/test_content.rb +13 -18
- data/test/test_content_scopes.rb +6 -7
- data/test/test_content_sections.rb +2 -2
- data/test/test_simple_backend.rb +3 -3
- data/test/test_translations.rb +16 -16
- metadata +4 -4
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.1.
|
|
1
|
+
1.1.1
|
data/test/helper.rb
CHANGED
|
@@ -36,10 +36,10 @@ class Test::Unit::TestCase
|
|
|
36
36
|
end
|
|
37
37
|
@uu = Zedkit::Users.verify(:username => TEST_GEMS_LOGIN, :password => TEST_GEMS_PASSWORD)
|
|
38
38
|
end
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
protected
|
|
41
41
|
def con_sections
|
|
42
|
-
Zedkit::Projects.content_sections(:user_key => @uu['user_key'], :project => { :uuid => @uu['projects'][0] })
|
|
42
|
+
Zedkit::Projects.content_sections(:user_key => @uu['user_key'], :project => { :uuid => @uu['projects'][0] })
|
|
43
43
|
end
|
|
44
44
|
def con_scopes
|
|
45
45
|
Zedlocales::ContentSections.scopes(:user_key => @uu['user_key'], :section => { :uuid => con_sections[0]['uuid'] })
|
data/test/test_content.rb
CHANGED
|
@@ -19,17 +19,16 @@ require 'helper'
|
|
|
19
19
|
|
|
20
20
|
class TestContent < Test::Unit::TestCase
|
|
21
21
|
def test_get_content
|
|
22
|
-
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'],
|
|
23
|
-
|
|
24
|
-
cc = Zedlocales::Content.get(:user_key => @uu['user_key'], :uuid => cs['content'][0]['uuid'])
|
|
22
|
+
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[0]['uuid'] })
|
|
23
|
+
cc = Zedlocales::Content.get(:user_key => @uu['user_key'], :uuid => cs[0]['uuid'])
|
|
25
24
|
assert_equal 'whatever', cc['key']
|
|
26
|
-
assert_equal cs[
|
|
25
|
+
assert_equal cs[0]['uuid'], cc['uuid']
|
|
27
26
|
end
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
def test_create_content
|
|
31
|
-
cc = Zedlocales::Content.create(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[
|
|
32
|
-
|
|
30
|
+
cc = Zedlocales::Content.create(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[0]['uuid'] },
|
|
31
|
+
:content => { :key => 'yo', :content => 'yo yo' })
|
|
33
32
|
assert_equal 32, cc['uuid'].length
|
|
34
33
|
assert_equal 'yo', cc['key']
|
|
35
34
|
assert_equal 'yo yo', cc['content']
|
|
@@ -37,28 +36,24 @@ class TestContent < Test::Unit::TestCase
|
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
def test_update_content
|
|
40
|
-
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'],
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
:uuid => cs['content'][0]['uuid'], :content => { :content => 'yo' })
|
|
44
|
-
assert_equal cs['content'][0]['uuid'], cc['uuid']
|
|
39
|
+
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[0]['uuid'] })
|
|
40
|
+
cc = Zedlocales::Content.update(:user_key => @uu['user_key'], :uuid => cs[0]['uuid'], :content => { :content => 'yo' })
|
|
41
|
+
assert_equal cs[0]['uuid'], cc['uuid']
|
|
45
42
|
assert_equal 'whatever', cc['key']
|
|
46
43
|
assert_equal 'yo', cc['content']
|
|
47
44
|
end
|
|
48
45
|
|
|
49
46
|
|
|
50
47
|
def test_destroy_content
|
|
51
|
-
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'],
|
|
52
|
-
|
|
53
|
-
cc = Zedlocales::Content.delete(:user_key => @uu['user_key'], :uuid => cs['content'][0]['uuid'])
|
|
48
|
+
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[0]['uuid'] })
|
|
49
|
+
cc = Zedlocales::Content.delete(:user_key => @uu['user_key'], :uuid => cs[0]['uuid'])
|
|
54
50
|
assert_equal cc, {}
|
|
55
51
|
end
|
|
56
52
|
|
|
57
53
|
|
|
58
54
|
def test_get_translations
|
|
59
|
-
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'],
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
assert_equal 2, tt['translations'].length
|
|
55
|
+
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[0]['uuid'] })
|
|
56
|
+
tt = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs[0]['uuid'] })
|
|
57
|
+
assert_equal 2, tt.length
|
|
63
58
|
end
|
|
64
59
|
end
|
data/test/test_content_scopes.rb
CHANGED
|
@@ -19,7 +19,7 @@ require 'helper'
|
|
|
19
19
|
|
|
20
20
|
class TestContentScopes < Test::Unit::TestCase
|
|
21
21
|
def test_get_content_scope
|
|
22
|
-
cs = Zedlocales::ContentScopes.get(:user_key => @uu['user_key'], :uuid => con_scopes[
|
|
22
|
+
cs = Zedlocales::ContentScopes.get(:user_key => @uu['user_key'], :uuid => con_scopes[0]['uuid'])
|
|
23
23
|
assert_equal 'whatever', cs['key']
|
|
24
24
|
end
|
|
25
25
|
|
|
@@ -34,21 +34,20 @@ class TestContentScopes < Test::Unit::TestCase
|
|
|
34
34
|
|
|
35
35
|
def test_update_content_scope
|
|
36
36
|
cs = Zedlocales::ContentScopes.update(:user_key => @uu['user_key'],
|
|
37
|
-
:uuid => con_scopes[
|
|
37
|
+
:uuid => con_scopes[0]['uuid'], :scope => { :key => "updated" })
|
|
38
38
|
assert_equal 'updated', cs['key']
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
def test_delete_content_scope
|
|
43
|
-
cs = Zedlocales::ContentScopes.delete(:user_key => @uu['user_key'], :uuid => con_scopes[
|
|
43
|
+
cs = Zedlocales::ContentScopes.delete(:user_key => @uu['user_key'], :uuid => con_scopes[0]['uuid'])
|
|
44
44
|
assert_equal cs, {}
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
def test_get_content
|
|
49
|
-
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'],
|
|
50
|
-
|
|
51
|
-
assert_equal
|
|
52
|
-
assert_equal 'whatever', cs['content'][0]['key']
|
|
49
|
+
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[0]['uuid'] })
|
|
50
|
+
assert_equal 32, cs[0]['uuid'].length
|
|
51
|
+
assert_equal 'whatever', cs[0]['key']
|
|
53
52
|
end
|
|
54
53
|
end
|
|
@@ -47,7 +47,7 @@ class TestContentSections < Test::Unit::TestCase
|
|
|
47
47
|
|
|
48
48
|
def test_get_content_section_scopes
|
|
49
49
|
ss = Zedlocales::ContentSections.scopes(:user_key => @uu['user_key'], :section => { :uuid => con_sections[0]['uuid'] })
|
|
50
|
-
assert_equal 32, ss[
|
|
51
|
-
assert_equal 'whatever', ss[
|
|
50
|
+
assert_equal 32, ss[0]['uuid'].length
|
|
51
|
+
assert_equal 'whatever', ss[0]['key']
|
|
52
52
|
end
|
|
53
53
|
end
|
data/test/test_simple_backend.rb
CHANGED
|
@@ -19,17 +19,17 @@ require 'helper'
|
|
|
19
19
|
|
|
20
20
|
class TestSimpleBackend < Test::Unit::TestCase
|
|
21
21
|
def test_get_english_locale
|
|
22
|
-
en = Zedlocales::Simple.get(:en)
|
|
22
|
+
en = Zedlocales::Simple.get(:en)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def test_get_french_locale
|
|
26
|
-
fr = Zedlocales::Simple.get(:fr)
|
|
26
|
+
fr = Zedlocales::Simple.get(:fr)
|
|
27
27
|
assert_not_nil fr
|
|
28
28
|
assert_equal ["dim", "lun", "mar", "mer", "jeu", "ven", "sam"], fr['fr']['date']['abbr_day_names']
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def test_get_spanish_locale
|
|
32
|
-
es = Zedlocales::Simple.get(:es)
|
|
32
|
+
es = Zedlocales::Simple.get(:es)
|
|
33
33
|
assert_not_nil es
|
|
34
34
|
assert_equal ["Dom", "Lun", "Mar", "Mie", "Jue", "Vie", "Sab"], es['es']['date']['abbr_day_names']
|
|
35
35
|
end
|
data/test/test_translations.rb
CHANGED
|
@@ -19,37 +19,37 @@ require 'helper'
|
|
|
19
19
|
|
|
20
20
|
class TestContent < Test::Unit::TestCase
|
|
21
21
|
def test_get_translation
|
|
22
|
-
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[
|
|
23
|
-
cc = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs[
|
|
24
|
-
tt = Zedlocales::Translations.get(:user_key => @uu['user_key'], :uuid => cc[
|
|
25
|
-
assert_equal tt['content']['uuid'], cs[
|
|
22
|
+
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[0]['uuid'] })
|
|
23
|
+
cc = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs[0]['uuid'] })
|
|
24
|
+
tt = Zedlocales::Translations.get(:user_key => @uu['user_key'], :uuid => cc[0]['uuid'])
|
|
25
|
+
assert_equal tt['content']['uuid'], cs[0]['uuid']
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
def test_create_translation
|
|
30
|
-
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[
|
|
31
|
-
tt = Zedlocales::Translations.create(:user_key => @uu['user_key'], :content => { :uuid => cs[
|
|
30
|
+
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[0]['uuid'] })
|
|
31
|
+
tt = Zedlocales::Translations.create(:user_key => @uu['user_key'], :content => { :uuid => cs[0]['uuid'] },
|
|
32
32
|
:translation => { :locale => 'de', :source => 'ZEDKIT', :translation => 'yo' })
|
|
33
|
-
assert_equal cs[
|
|
33
|
+
assert_equal cs[0]['uuid'], tt['content']['uuid']
|
|
34
34
|
assert_equal 'yo', tt['translation']
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
def test_update_translation
|
|
39
|
-
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[
|
|
40
|
-
cc = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs[
|
|
39
|
+
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[0]['uuid'] })
|
|
40
|
+
cc = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs[0]['uuid'] })
|
|
41
41
|
tt = Zedlocales::Translations.update(:user_key => @uu['user_key'],
|
|
42
|
-
:uuid => cc[
|
|
43
|
-
assert_equal cs[
|
|
44
|
-
assert_equal cc[
|
|
42
|
+
:uuid => cc[0]['uuid'], :translation => { :translation => 'yo' })
|
|
43
|
+
assert_equal cs[0]['uuid'], tt['content']['uuid']
|
|
44
|
+
assert_equal cc[0]['uuid'], tt['uuid']
|
|
45
45
|
assert_equal 'yo', tt['translation']
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
def test_destroy_translation
|
|
50
|
-
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[
|
|
51
|
-
cc = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs[
|
|
52
|
-
tt = Zedlocales::Translations.get(:user_key => @uu['user_key'], :uuid => cc[
|
|
53
|
-
assert_equal tt['content']['uuid'], cs[
|
|
50
|
+
cs = Zedlocales::ContentScopes.content(:user_key => @uu['user_key'], :scope => { :uuid => con_scopes[0]['uuid'] })
|
|
51
|
+
cc = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs[0]['uuid'] })
|
|
52
|
+
tt = Zedlocales::Translations.get(:user_key => @uu['user_key'], :uuid => cc[0]['uuid'])
|
|
53
|
+
assert_equal tt['content']['uuid'], cs[0]['uuid']
|
|
54
54
|
end
|
|
55
55
|
end
|
metadata
CHANGED
|
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
|
5
5
|
segments:
|
|
6
6
|
- 1
|
|
7
7
|
- 1
|
|
8
|
-
-
|
|
9
|
-
version: 1.1.
|
|
8
|
+
- 1
|
|
9
|
+
version: 1.1.1
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Eric Woodward
|
|
@@ -95,8 +95,8 @@ homepage: http://github.com/ejw/zedlocales
|
|
|
95
95
|
licenses: []
|
|
96
96
|
|
|
97
97
|
post_install_message:
|
|
98
|
-
rdoc_options:
|
|
99
|
-
|
|
98
|
+
rdoc_options: []
|
|
99
|
+
|
|
100
100
|
require_paths:
|
|
101
101
|
- lib
|
|
102
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|