ruby-lokalise-api 2.8.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +2 -0
  4. data/README.md +1 -0
  5. data/Rakefile +6 -1
  6. data/lib/ruby-lokalise-api.rb +2 -0
  7. data/lib/ruby-lokalise-api/client.rb +2 -0
  8. data/lib/ruby-lokalise-api/collections/base.rb +2 -0
  9. data/lib/ruby-lokalise-api/collections/branch.rb +3 -1
  10. data/lib/ruby-lokalise-api/collections/contributor.rb +2 -0
  11. data/lib/ruby-lokalise-api/collections/custom_translation_status.rb +3 -1
  12. data/lib/ruby-lokalise-api/collections/file.rb +2 -0
  13. data/lib/ruby-lokalise-api/collections/key.rb +2 -0
  14. data/lib/ruby-lokalise-api/collections/key_comment.rb +2 -0
  15. data/lib/ruby-lokalise-api/collections/order.rb +2 -0
  16. data/lib/ruby-lokalise-api/collections/payment_card.rb +2 -0
  17. data/lib/ruby-lokalise-api/collections/project.rb +2 -0
  18. data/lib/ruby-lokalise-api/collections/project_comment.rb +2 -0
  19. data/lib/ruby-lokalise-api/collections/project_language.rb +2 -0
  20. data/lib/ruby-lokalise-api/collections/screenshot.rb +2 -0
  21. data/lib/ruby-lokalise-api/collections/snapshot.rb +2 -0
  22. data/lib/ruby-lokalise-api/collections/system_language.rb +2 -0
  23. data/lib/ruby-lokalise-api/collections/task.rb +2 -0
  24. data/lib/ruby-lokalise-api/collections/team.rb +2 -0
  25. data/lib/ruby-lokalise-api/collections/team_user.rb +2 -0
  26. data/lib/ruby-lokalise-api/collections/team_user_group.rb +3 -1
  27. data/lib/ruby-lokalise-api/collections/translation.rb +2 -0
  28. data/lib/ruby-lokalise-api/collections/translation_provider.rb +2 -0
  29. data/lib/ruby-lokalise-api/collections/webhook.rb +2 -0
  30. data/lib/ruby-lokalise-api/connection.rb +3 -1
  31. data/lib/ruby-lokalise-api/error.rb +2 -0
  32. data/lib/ruby-lokalise-api/json_handler.rb +4 -0
  33. data/lib/ruby-lokalise-api/request.rb +2 -0
  34. data/lib/ruby-lokalise-api/resources/base.rb +2 -0
  35. data/lib/ruby-lokalise-api/resources/branch.rb +2 -0
  36. data/lib/ruby-lokalise-api/resources/contributor.rb +3 -1
  37. data/lib/ruby-lokalise-api/resources/custom_translation_status.rb +3 -1
  38. data/lib/ruby-lokalise-api/resources/file.rb +2 -0
  39. data/lib/ruby-lokalise-api/resources/key.rb +2 -0
  40. data/lib/ruby-lokalise-api/resources/key_comment.rb +4 -2
  41. data/lib/ruby-lokalise-api/resources/order.rb +2 -0
  42. data/lib/ruby-lokalise-api/resources/payment_card.rb +2 -0
  43. data/lib/ruby-lokalise-api/resources/project.rb +2 -0
  44. data/lib/ruby-lokalise-api/resources/project_comment.rb +3 -1
  45. data/lib/ruby-lokalise-api/resources/project_language.rb +4 -2
  46. data/lib/ruby-lokalise-api/resources/screenshot.rb +2 -0
  47. data/lib/ruby-lokalise-api/resources/snapshot.rb +2 -0
  48. data/lib/ruby-lokalise-api/resources/system_language.rb +3 -1
  49. data/lib/ruby-lokalise-api/resources/task.rb +2 -0
  50. data/lib/ruby-lokalise-api/resources/team.rb +2 -0
  51. data/lib/ruby-lokalise-api/resources/team_user.rb +3 -1
  52. data/lib/ruby-lokalise-api/resources/team_user_group.rb +4 -2
  53. data/lib/ruby-lokalise-api/resources/translation.rb +2 -0
  54. data/lib/ruby-lokalise-api/resources/translation_provider.rb +2 -0
  55. data/lib/ruby-lokalise-api/resources/webhook.rb +2 -0
  56. data/lib/ruby-lokalise-api/rest/branches.rb +2 -0
  57. data/lib/ruby-lokalise-api/rest/comments.rb +2 -0
  58. data/lib/ruby-lokalise-api/rest/contributors.rb +2 -0
  59. data/lib/ruby-lokalise-api/rest/custom_translation_statuses.rb +2 -0
  60. data/lib/ruby-lokalise-api/rest/files.rb +2 -0
  61. data/lib/ruby-lokalise-api/rest/keys.rb +2 -0
  62. data/lib/ruby-lokalise-api/rest/languages.rb +2 -0
  63. data/lib/ruby-lokalise-api/rest/orders.rb +2 -0
  64. data/lib/ruby-lokalise-api/rest/payment_cards.rb +2 -0
  65. data/lib/ruby-lokalise-api/rest/projects.rb +2 -0
  66. data/lib/ruby-lokalise-api/rest/screenshots.rb +2 -0
  67. data/lib/ruby-lokalise-api/rest/snapshots.rb +2 -0
  68. data/lib/ruby-lokalise-api/rest/tasks.rb +2 -0
  69. data/lib/ruby-lokalise-api/rest/team_user_group.rb +2 -0
  70. data/lib/ruby-lokalise-api/rest/team_users.rb +2 -0
  71. data/lib/ruby-lokalise-api/rest/teams.rb +2 -0
  72. data/lib/ruby-lokalise-api/rest/translation_providers.rb +2 -0
  73. data/lib/ruby-lokalise-api/rest/translations.rb +2 -0
  74. data/lib/ruby-lokalise-api/rest/webhooks.rb +2 -0
  75. data/lib/ruby-lokalise-api/utils/attribute_helpers.rb +2 -0
  76. data/lib/ruby-lokalise-api/utils/endpoint_helpers.rb +2 -0
  77. data/lib/ruby-lokalise-api/utils/string_utils.rb +2 -0
  78. data/lib/ruby-lokalise-api/version.rb +3 -1
  79. data/ruby-lokalise-api.gemspec +7 -2
  80. data/spec/lib/ruby-lokalise-api/connection_spec.rb +10 -7
  81. data/spec/lib/ruby-lokalise-api/custom_json_parser_spec.rb +9 -5
  82. data/spec/lib/ruby-lokalise-api/error_spec.rb +7 -4
  83. data/spec/lib/ruby-lokalise-api/rest/branches_spec.rb +7 -5
  84. data/spec/lib/ruby-lokalise-api/rest/comments_spec.rb +7 -5
  85. data/spec/lib/ruby-lokalise-api/rest/contributors_spec.rb +6 -4
  86. data/spec/lib/ruby-lokalise-api/rest/custom_translation_statuses_spec.rb +6 -4
  87. data/spec/lib/ruby-lokalise-api/rest/files_spec.rb +4 -2
  88. data/spec/lib/ruby-lokalise-api/rest/keys_spec.rb +8 -6
  89. data/spec/lib/ruby-lokalise-api/rest/languages_spec.rb +8 -6
  90. data/spec/lib/ruby-lokalise-api/rest/orders_spec.rb +4 -2
  91. data/spec/lib/ruby-lokalise-api/rest/payment_cards_spec.rb +5 -3
  92. data/spec/lib/ruby-lokalise-api/rest/projects_spec.rb +6 -4
  93. data/spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb +6 -4
  94. data/spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb +6 -4
  95. data/spec/lib/ruby-lokalise-api/rest/tasks_spec.rb +6 -4
  96. data/spec/lib/ruby-lokalise-api/rest/team_user_groups_spec.rb +8 -6
  97. data/spec/lib/ruby-lokalise-api/rest/team_users_spec.rb +6 -4
  98. data/spec/lib/ruby-lokalise-api/rest/teams_spec.rb +2 -0
  99. data/spec/lib/ruby-lokalise-api/rest/translation_providers_spec.rb +4 -2
  100. data/spec/lib/ruby-lokalise-api/rest/translations_spec.rb +8 -6
  101. data/spec/lib/ruby-lokalise-api/rest/webhooks_spec.rb +4 -2
  102. data/spec/lib/ruby-lokalise-api/utils/snakecase_spec.rb +2 -0
  103. data/spec/lib/ruby-lokalise-api_spec.rb +12 -9
  104. data/spec/spec_helper.rb +8 -1
  105. data/spec/support/test_client.rb +2 -0
  106. data/spec/support/vcr.rb +2 -0
  107. metadata +49 -7
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  module Resources
3
5
  class Translation < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  module Resources
3
5
  class TranslationProvider < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  module Resources
3
5
  class Webhook < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all branches for the given project
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns a single comment for the given key
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all contributors for the given project
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all translation statuses for the given project
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all translation files for the given project
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all translation keys for the given project
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all languages supported by Lokalise
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all orders for the given team
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all payment cards available to the user authorized with the API token
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all projects available to the user authorized with the API token
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all screenshots for the given project
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all snapshots for the given project
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all tasks for the given project
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all team user groups for the given team
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all team users for the given team
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all teams available to the user
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all translation providers for the given team
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all translations for the given project (ungrouped)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  class Client
3
5
  # Returns all webhooks for the given project
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  module Utils
3
5
  module AttributeHelpers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
4
  module Utils
3
5
  module EndpointHelpers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Initial code taken from Facets gem by Rubyworks
2
4
  # https://github.com/rubyworks/facets/blob/master/lib/core/facets/string/snakecase.rb
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lokalise
2
- VERSION = '2.8.0'.freeze
4
+ VERSION = '2.9.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path('lib/ruby-lokalise-api/version', __dir__)
2
4
 
3
5
  Gem::Specification.new do |spec|
@@ -21,14 +23,17 @@ Gem::Specification.new do |spec|
21
23
  spec.require_paths = ['lib']
22
24
 
23
25
  spec.add_dependency 'addressable', '~> 2.5'
24
- spec.add_dependency 'faraday', '~> 0.13'
26
+ spec.add_dependency 'faraday', '~> 1.0'
27
+ spec.add_dependency 'json', '~> 2.3'
25
28
 
29
+ spec.add_development_dependency 'codecov', '~> 0.1'
26
30
  spec.add_development_dependency 'dotenv', '~> 2.5'
27
31
  spec.add_development_dependency 'oj', '~> 3.8'
28
32
  spec.add_development_dependency 'rake', '~> 13.0'
29
33
  spec.add_development_dependency 'rspec', '~> 3.6'
30
34
  spec.add_development_dependency 'rubocop', '~> 0.60'
31
- spec.add_development_dependency 'rubocop-performance', '~> 1.0'
35
+ spec.add_development_dependency 'rubocop-performance', '~> 1.5'
36
+ spec.add_development_dependency 'rubocop-rspec', '~> 1.37'
32
37
  spec.add_development_dependency 'simplecov', '~> 0.16'
33
38
  spec.add_development_dependency 'vcr', '~> 5.0'
34
39
  end
@@ -1,8 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Lokalise::Connection do
2
4
  include described_class
3
5
 
4
- before(:each) { Lokalise.reset_client! }
5
- after(:all) do
6
+ before { Lokalise.reset_client! }
7
+
8
+ after do
6
9
  Lokalise.reset_client!
7
10
  Faraday.default_adapter = :net_http
8
11
  end
@@ -14,7 +17,7 @@ RSpec.describe Lokalise::Connection do
14
17
  expect(conn.headers['X-api-token']).to eq(test_client.token)
15
18
  end
16
19
 
17
- it 'should allow to customize timeouts' do
20
+ it 'allows to customize timeouts' do
18
21
  custom_client = Lokalise.client(ENV['LOKALISE_API_TOKEN'],
19
22
  open_timeout: 100, timeout: 500)
20
23
  conn = connection custom_client
@@ -29,14 +32,14 @@ RSpec.describe Lokalise::Connection do
29
32
  expect(another_conn.options.open_timeout).to eq(200)
30
33
  end
31
34
 
32
- it 'should be possible to customize adapter' do
35
+ it 'is possible to customize adapter' do
33
36
  conn = connection test_client
34
- expect(conn.builder.handlers).to include(Faraday::Adapter::NetHttp)
37
+ expect(conn.builder.adapter).to eq(Faraday::Adapter::NetHttp)
35
38
 
36
39
  Faraday.default_adapter = :excon
37
40
 
38
41
  another_conn = connection test_client
39
- expect(another_conn.builder.handlers).to include(Faraday::Adapter::Excon)
40
- expect(conn.builder.handlers).to include(Faraday::Adapter::NetHttp)
42
+ expect(another_conn.builder.adapter).to eq(Faraday::Adapter::Excon)
43
+ expect(conn.builder.adapter).to eq(Faraday::Adapter::NetHttp)
41
44
  end
42
45
  end
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'oj'
2
4
 
3
- RSpec.describe 'Custom JSON parser' do
5
+ RSpec.describe Lokalise::JsonHandler do
4
6
  let(:loaded_json) do
5
7
  {'projects' => [{'project_id' => '547879415c01a0e6e0b855.29978928',
6
8
  'name' => 'demo phoenix copy',
@@ -25,7 +27,8 @@ RSpec.describe 'Custom JSON parser' do
25
27
  '{":name":"rspec proj",":description":"demo project for rspec"}'
26
28
  end
27
29
 
28
- before :all do
30
+ # rubocop:disable RSpec/LeakyConstantDeclaration
31
+ before do
29
32
  module Lokalise
30
33
  module JsonHandler
31
34
  def custom_dump(obj)
@@ -39,7 +42,7 @@ RSpec.describe 'Custom JSON parser' do
39
42
  end
40
43
  end
41
44
 
42
- after :all do
45
+ after do
43
46
  module Lokalise
44
47
  module JsonHandler
45
48
  def custom_dump(obj)
@@ -52,8 +55,9 @@ RSpec.describe 'Custom JSON parser' do
52
55
  end
53
56
  end
54
57
  end
58
+ # rubocop:enable RSpec/LeakyConstantDeclaration
55
59
 
56
- it 'should allow to customize #load' do
60
+ it 'allows to customize #load' do
57
61
  expect(Oj).to receive(:load).and_return(loaded_json)
58
62
  expect(JSON).not_to receive(:parse)
59
63
  projects = VCR.use_cassette('all_projects_pagination') do
@@ -65,7 +69,7 @@ RSpec.describe 'Custom JSON parser' do
65
69
  expect(projects.collection.first.name).to eq('demo phoenix copy')
66
70
  end
67
71
 
68
- it 'should allow to customize #dump' do
72
+ it 'allows to customize #dump' do
69
73
  expect(Oj).to receive(:dump).and_return(dumped_json)
70
74
  expect(JSON).not_to receive(:dump)
71
75
  project = VCR.use_cassette('new_project') do
@@ -1,10 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Lokalise::Error do
2
4
  include Lokalise::Request
3
5
 
4
- before(:each) { Lokalise.reset_client! }
5
- after(:all) { Lokalise.reset_client! }
6
+ before { Lokalise.reset_client! }
7
+
8
+ after { Lokalise.reset_client! }
6
9
 
7
- it 'should raise BadRequest when API token is invalid' do
10
+ it 'raises BadRequest when API token is invalid' do
8
11
  expect do
9
12
  VCR.use_cassette('error_invalid_token') do
10
13
  get 'projects', Lokalise.client('invalid')
@@ -12,7 +15,7 @@ RSpec.describe Lokalise::Error do
12
15
  end.to raise_error(Lokalise::Error::BadRequest)
13
16
  end
14
17
 
15
- it 'should raise NotFound when the provided path cannot be found' do
18
+ it 'raises NotFound when the provided path cannot be found' do
16
19
  expect do
17
20
  VCR.use_cassette('error_not_found') do
18
21
  get 'invalid_path', test_client
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Lokalise::Client do
2
4
  let(:project_id) { '803826145ba90b42d5d860.46800099' }
3
5
  let(:branch_id) { 41_302 }
4
6
 
5
7
  describe '#branches' do
6
- it 'should return all branches' do
8
+ it 'returns all branches' do
7
9
  branches = VCR.use_cassette('all_branches') do
8
10
  test_client.branches project_id
9
11
  end.collection
@@ -11,7 +13,7 @@ RSpec.describe Lokalise::Client do
11
13
  expect(branches.count).to eq(1)
12
14
  end
13
15
 
14
- it 'should support pagination' do
16
+ it 'supports pagination' do
15
17
  branches = VCR.use_cassette('all_branches_pagination') do
16
18
  test_client.branches project_id, limit: 1, page: 1
17
19
  end
@@ -82,8 +84,8 @@ RSpec.describe Lokalise::Client do
82
84
  expect(response['branch']['name']).to eq(branch.name)
83
85
  end
84
86
 
85
- context 'branch chained methods' do
86
- it 'should support merge' do
87
+ context 'when branch methods are chained' do
88
+ it 'supports merge' do
87
89
  branch = VCR.use_cassette('create_branch_to_merge2') do
88
90
  test_client.create_branch project_id, name: 'merge-me-plz'
89
91
  end
@@ -102,7 +104,7 @@ RSpec.describe Lokalise::Client do
102
104
  expect(response['branch']['name']).to eq(branch.name)
103
105
  end
104
106
 
105
- it 'should support update and destroy' do
107
+ it 'supports update and destroy' do
106
108
  branch = VCR.use_cassette('create_another_branch') do
107
109
  test_client.create_branch project_id, name: 'ruby-second-branch'
108
110
  end
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Lokalise::Client do
2
4
  let(:project_id) { '803826145ba90b42d5d860.46800099' }
3
5
  let(:key_id) { 15_305_182 }
4
6
  let(:another_key_id) { 15_519_786 }
5
7
 
6
8
  describe '#comments' do
7
- it 'should return all comments' do
9
+ it 'returns all comments' do
8
10
  comments = VCR.use_cassette('all_comments') do
9
11
  test_client.comments project_id, key_id
10
12
  end.collection
@@ -12,7 +14,7 @@ RSpec.describe Lokalise::Client do
12
14
  expect(comments.count).to eq(3)
13
15
  end
14
16
 
15
- it 'should support pagination' do
17
+ it 'supports pagination' do
16
18
  comments = VCR.use_cassette('all_comments_pagination') do
17
19
  test_client.comments project_id, key_id, limit: 1, page: 2
18
20
  end
@@ -29,7 +31,7 @@ RSpec.describe Lokalise::Client do
29
31
  expect(comments.prev_page?).to eq(true)
30
32
  expect(comments.first_page?).to eq(false)
31
33
 
32
- expect(comments.client).to be_an_instance_of(Lokalise::Client)
34
+ expect(comments.client).to be_an_instance_of(described_class)
33
35
  end
34
36
  end
35
37
 
@@ -85,8 +87,8 @@ RSpec.describe Lokalise::Client do
85
87
  expect(response['comment_deleted']).to eq(true)
86
88
  end
87
89
 
88
- context 'comment chained methods' do
89
- it 'should support destroy' do
90
+ context 'when comment methods are chained' do
91
+ it 'supports destroy' do
90
92
  comment = VCR.use_cassette('create_another_comment') do
91
93
  test_client.create_comments project_id, another_key_id, comment: 'chained comment'
92
94
  end.collection.first
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Lokalise::Client do
2
4
  let(:project_id) { '803826145ba90b42d5d860.46800099' }
3
5
  let(:contributor_id) { 25_953 }
4
6
 
5
7
  describe '#contributors' do
6
- it 'should return all contributors' do
8
+ it 'returns all contributors' do
7
9
  contributors = VCR.use_cassette('all_contributors') do
8
10
  test_client.contributors project_id
9
11
  end.collection
@@ -12,7 +14,7 @@ RSpec.describe Lokalise::Client do
12
14
  expect(contributors.first.fullname).to eq('John Doe')
13
15
  end
14
16
 
15
- it 'should support pagination' do
17
+ it 'supports pagination' do
16
18
  contributors = VCR.use_cassette('all_contributors_pagination') do
17
19
  test_client.contributors project_id, limit: 1, page: 2
18
20
  end
@@ -83,8 +85,8 @@ RSpec.describe Lokalise::Client do
83
85
  expect(response['contributor_deleted']).to eq(true)
84
86
  end
85
87
 
86
- context 'contributor chained methods' do
87
- it 'should support update and destroy' do
88
+ context 'when contributor methods are chained' do
89
+ it 'supports update and destroy' do
88
90
  contributor = VCR.use_cassette('create_another_contributor') do
89
91
  test_client.create_contributors project_id,
90
92
  email: 'demo@test.com',
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Lokalise::Client do
2
4
  let(:project_id) { '803826145ba90b42d5d860.46800099' }
3
5
  let(:status_id) { 128 }
4
6
  let(:new_status_id) { 126 }
5
7
 
6
8
  describe '#translation_statuses' do
7
- it 'should return all statuses' do
9
+ it 'returns all statuses' do
8
10
  statuses = VCR.use_cassette('all_translation_statuses') do
9
11
  test_client.translation_statuses project_id
10
12
  end.collection
@@ -13,7 +15,7 @@ RSpec.describe Lokalise::Client do
13
15
  expect(statuses.first.status_id).to eq(status_id)
14
16
  end
15
17
 
16
- it 'should support pagination' do
18
+ it 'supports pagination' do
17
19
  statuses = VCR.use_cassette('all_translation_statuses_pagination') do
18
20
  test_client.translation_statuses project_id, limit: 1, page: 2
19
21
  end
@@ -85,8 +87,8 @@ RSpec.describe Lokalise::Client do
85
87
  expect(response).to include('#f2d600')
86
88
  end
87
89
 
88
- context 'translation status chained methods' do
89
- it 'should support update and destroy' do
90
+ context 'when translation status methods are chained' do
91
+ it 'supports update and destroy' do
90
92
  status = VCR.use_cassette('create_another_translation_status') do
91
93
  test_client.create_translation_status project_id,
92
94
  title: 'rspec',