zedlocales 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
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] })['sections']
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
- :scope => { :uuid => con_scopes['scopes'][0]['uuid'] })
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['content'][0]['uuid'], cc['uuid']
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['scopes'][0]['uuid'] },
32
- :content => { :key => 'yo', :content => 'yo yo' })
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
- :scope => { :uuid => con_scopes['scopes'][0]['uuid'] })
42
- cc = Zedlocales::Content.update(:user_key => @uu['user_key'],
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
- :scope => { :uuid => con_scopes['scopes'][0]['uuid'] })
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
- :scope => { :uuid => con_scopes['scopes'][0]['uuid'] })
61
- tt = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs['content'][0]['uuid'] })
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
@@ -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['scopes'][0]['uuid'])
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['scopes'][0]['uuid'], :scope => { :key => "updated" })
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['scopes'][0]['uuid'])
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
- :scope => { :uuid => con_scopes['scopes'][0]['uuid'] })
51
- assert_equal 32, cs['content'][0]['uuid'].length
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['scopes'][0]['uuid'].length
51
- assert_equal 'whatever', ss['scopes'][0]['key']
50
+ assert_equal 32, ss[0]['uuid'].length
51
+ assert_equal 'whatever', ss[0]['key']
52
52
  end
53
53
  end
@@ -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)['content']
22
+ en = Zedlocales::Simple.get(:en)
23
23
  end
24
24
 
25
25
  def test_get_french_locale
26
- fr = Zedlocales::Simple.get(:fr)['content']
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)['content']
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
@@ -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['scopes'][0]['uuid'] })
23
- cc = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs['content'][0]['uuid'] })
24
- tt = Zedlocales::Translations.get(:user_key => @uu['user_key'], :uuid => cc['translations'][0]['uuid'])
25
- assert_equal tt['content']['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.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['scopes'][0]['uuid'] })
31
- tt = Zedlocales::Translations.create(:user_key => @uu['user_key'], :content => { :uuid => cs['content'][0]['uuid'] },
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['content'][0]['uuid'], tt['content']['uuid']
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['scopes'][0]['uuid'] })
40
- cc = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs['content'][0]['uuid'] })
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['translations'][0]['uuid'], :translation => { :translation => 'yo' })
43
- assert_equal cs['content'][0]['uuid'], tt['content']['uuid']
44
- assert_equal cc['translations'][0]['uuid'], tt['uuid']
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['scopes'][0]['uuid'] })
51
- cc = Zedlocales::Content.translations(:user_key => @uu['user_key'], :content => { :uuid => cs['content'][0]['uuid'] })
52
- tt = Zedlocales::Translations.get(:user_key => @uu['user_key'], :uuid => cc['translations'][0]['uuid'])
53
- assert_equal tt['content']['uuid'], cs['content'][0]['uuid']
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
- - 0
9
- version: 1.1.0
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
- - --charset=UTF-8
98
+ rdoc_options: []
99
+
100
100
  require_paths:
101
101
  - lib
102
102
  required_ruby_version: !ruby/object:Gem::Requirement