finapps 2.1.4 → 2.2.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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -18
  3. data/.ruby-gemset +1 -1
  4. data/.travis.yml +5 -2
  5. data/README.md +1 -1
  6. data/finapps.gemspec +10 -12
  7. data/lib/finapps.rb +5 -21
  8. data/lib/finapps/rest/client.rb +42 -53
  9. data/lib/finapps/rest/institutions.rb +2 -2
  10. data/lib/finapps/rest/institutions_forms.rb +2 -2
  11. data/lib/finapps/rest/order_reports.rb +4 -4
  12. data/lib/finapps/rest/order_statuses.rb +2 -2
  13. data/lib/finapps/rest/order_tokens.rb +2 -3
  14. data/lib/finapps/rest/orders.rb +6 -6
  15. data/lib/finapps/rest/password_resets.rb +4 -4
  16. data/lib/finapps/rest/sessions.rb +2 -2
  17. data/lib/finapps/rest/user_institutions.rb +21 -26
  18. data/lib/finapps/rest/user_institutions_forms.rb +2 -2
  19. data/lib/finapps/rest/user_institutions_statuses.rb +2 -2
  20. data/lib/finapps/rest/users.rb +5 -5
  21. data/lib/finapps/rest/version.rb +1 -1
  22. data/lib/finapps/version.rb +1 -1
  23. data/spec/rest/client_spec.rb +4 -13
  24. data/spec/rest/institutions_forms_spec.rb +5 -2
  25. data/spec/rest/institutions_spec.rb +4 -2
  26. data/spec/rest/order_reports_spec.rb +4 -4
  27. data/spec/rest/order_statuses_spec.rb +3 -2
  28. data/spec/rest/order_tokens_spec.rb +3 -2
  29. data/spec/rest/orders_spec.rb +6 -5
  30. data/spec/rest/password_resets_spec.rb +4 -4
  31. data/spec/rest/sessions_spec.rb +2 -2
  32. data/spec/rest/user_institutions_forms_spec.rb +5 -2
  33. data/spec/rest/user_institutions_spec.rb +10 -9
  34. data/spec/rest/user_institutions_statuses_spec.rb +3 -2
  35. data/spec/rest/users_spec.rb +4 -4
  36. data/spec/rest/version_spec.rb +1 -1
  37. data/spec/spec_helper.rb +5 -3
  38. data/spec/spec_helpers/client.rb +1 -1
  39. metadata +49 -124
  40. data/lib/core_extensions/hash/compact.rb +0 -23
  41. data/lib/core_extensions/object/blank.rb +0 -69
  42. data/lib/core_extensions/object/is_integer.rb +0 -10
  43. data/lib/core_extensions/string/json_to_hash.rb +0 -10
  44. data/lib/finapps/error.rb +0 -17
  45. data/lib/finapps/middleware/middleware.rb +0 -22
  46. data/lib/finapps/middleware/request/accept_json.rb +0 -14
  47. data/lib/finapps/middleware/request/no_encoding_basic_authentication.rb +0 -21
  48. data/lib/finapps/middleware/request/tenant_authentication.rb +0 -20
  49. data/lib/finapps/middleware/request/user_agent.rb +0 -15
  50. data/lib/finapps/middleware/response/custom_logger.rb +0 -41
  51. data/lib/finapps/middleware/response/raise_error.rb +0 -46
  52. data/lib/finapps/rest/base_client.rb +0 -122
  53. data/lib/finapps/rest/configuration.rb +0 -31
  54. data/lib/finapps/rest/connection.rb +0 -35
  55. data/lib/finapps/rest/credentials.rb +0 -21
  56. data/lib/finapps/rest/defaults.rb +0 -80
  57. data/lib/finapps/rest/resources.rb +0 -64
  58. data/lib/finapps/utils/loggeable.rb +0 -14
  59. data/lib/finapps/utils/parameter_filter.rb +0 -32
  60. data/spec/core_extensions/hash/compact_spec.rb +0 -21
  61. data/spec/core_extensions/object/is_integer_spec.rb +0 -17
  62. data/spec/middleware/request/accept_json_spec.rb +0 -12
  63. data/spec/middleware/request/no_encoding_basic_authentication_spec.rb +0 -32
  64. data/spec/middleware/request/tenant_authentication_spec.rb +0 -34
  65. data/spec/middleware/request/user_agent_spec.rb +0 -12
  66. data/spec/middleware/response/raise_error_spec.rb +0 -24
  67. data/spec/rest/base_client_spec.rb +0 -120
  68. data/spec/rest/configuration_spec.rb +0 -39
  69. data/spec/rest/credentials_spec.rb +0 -20
  70. data/spec/rest/resources_spec.rb +0 -76
  71. data/spec/rest/timeout_spec.rb +0 -9
  72. data/spec/support/fixtures/relevance_ruleset_names.json +0 -47
  73. data/spec/utils/parameter_filter_spec.rb +0 -23
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
  module FinApps
3
3
  module REST
4
- class UserInstitutionsForms < FinApps::REST::Resources
4
+ class UserInstitutionsForms < FinAppsCore::REST::Resources
5
5
  using ObjectExtensions
6
6
  using StringExtensions
7
7
 
8
8
  def show(id)
9
- raise MissingArgumentsError.new 'Missing argument: id.' if id.blank?
9
+ not_blank(id, :id)
10
10
 
11
11
  path = "institutions/user/#{ERB::Util.url_encode(id)}/form"
12
12
  super id, path
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
  module FinApps
3
3
  module REST
4
- class UserInstitutionsStatuses < FinApps::REST::Resources # :nodoc:
4
+ class UserInstitutionsStatuses < FinAppsCore::REST::Resources # :nodoc:
5
5
  using ObjectExtensions
6
6
  using StringExtensions
7
7
 
8
8
  def show(id)
9
- raise MissingArgumentsError.new 'Missing argument: ui_id' if id.blank?
9
+ not_blank(id, :id)
10
10
 
11
11
  path = "institutions/user/#{ERB::Util.url_encode(id)}/status"
12
12
  super id, path
@@ -1,29 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
  module FinApps
3
3
  module REST
4
- class Users < FinApps::REST::Resources # :nodoc:
4
+ class Users < FinAppsCore::REST::Resources # :nodoc:
5
5
  using ObjectExtensions
6
6
  using StringExtensions
7
7
 
8
8
  # @param [String] public_id
9
9
  # @return [FinApps::REST::User, Array<String>]
10
10
  def show(public_id)
11
- raise MissingArgumentsError.new 'Missing argument: public_id.' if public_id.blank?
11
+ not_blank(public_id, :public_id)
12
12
  super public_id
13
13
  end
14
14
 
15
15
  # @param [Hash] params
16
16
  # @return [Array<String>]
17
17
  def update(public_id, params)
18
- raise MissingArgumentsError.new 'Missing argument: public_id.' if public_id.blank?
19
- raise MissingArgumentsError.new 'Missing argument: params.' if params.blank?
18
+ not_blank(public_id, :public_id)
19
+ not_blank(params, :params)
20
20
 
21
21
  path = "#{end_point}/#{ERB::Util.url_encode(public_id)}#{'/password' if password_update?(params)}"
22
22
  super params, path
23
23
  end
24
24
 
25
25
  def destroy(public_id)
26
- raise MissingArgumentsError.new 'Missing argument: public_id.' if public_id.blank?
26
+ not_blank(public_id, :public_id)
27
27
  super public_id
28
28
  end
29
29
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  module FinApps
3
3
  module REST
4
- class Version < FinApps::REST::Resources # :nodoc:
4
+ class Version < FinAppsCore::REST::Resources # :nodoc:
5
5
  def show
6
6
  super nil, end_point
7
7
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module FinApps
3
- VERSION = '2.1.4'
3
+ VERSION = '2.2.1'
4
4
  end
@@ -1,20 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe FinApps::REST::Client do
3
3
  describe '#new' do
4
- it 'raises for missing company_identifier' do
5
- expect { FinApps::REST::Client.new nil, :company_token }.to raise_error(FinApps::MissingArgumentsError)
6
- end
7
-
8
4
  it 'raises for missing company_token' do
9
- expect { FinApps::REST::Client.new :company_identifier, nil }.to raise_error(FinApps::MissingArgumentsError)
5
+ expect { FinApps::REST::Client.new nil }.to raise_error(FinAppsCore::MissingArgumentsError)
10
6
  end
11
7
  end
12
8
 
13
9
  context 'an instance of Client' do
14
- subject { FinApps::REST::Client.new(:company_identifier, :company_token) }
10
+ subject { FinApps::REST::Client.new(:company_token) }
15
11
 
16
- %i(version users sessions orders order_tokens order_reports order_statuses institutions institutions_forms
17
- user_institutions_statuses user_institutions user_institutions_forms password_resets).each do |method|
12
+ FinApps::REST::Client::RESOURCES.each do |method|
18
13
  it "responds to #{method}" do
19
14
  expect(subject).to respond_to(method)
20
15
  end
@@ -72,11 +67,7 @@ RSpec.describe FinApps::REST::Client do
72
67
  it { expect(subject.password_resets).to be_an_instance_of(FinApps::REST::PasswordResets) }
73
68
  end
74
69
 
75
- # [:users, :institutions, :user_institutions, :transactions, :categories,
76
- # :budget_models, :budget_calculation, :budgets, :cashflows,
77
- # :alert, :alert_definition, :alert_preferences, :alert_settings, :rule_sets]
78
- %i(version users sessions orders order_tokens order_reports order_statuses institutions institutions_forms
79
- user_institutions_statuses user_institutions user_institutions_forms password_resets).each do |method|
70
+ FinApps::REST::Client::RESOURCES.each do |method|
80
71
  it "memoizes the result of #{method}" do
81
72
  first = subject.send(method)
82
73
  second = subject.send(method)
@@ -1,10 +1,13 @@
1
1
  # frozen_string_literal: true
2
+ require 'spec_helpers/client'
3
+
2
4
  RSpec.describe FinApps::REST::InstitutionsForms do
3
- let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
5
+ include SpecHelpers::Client
6
+
4
7
  describe '#show' do
5
8
  context 'when missing site id' do
6
9
  subject { FinApps::REST::InstitutionsForms.new(client).show(nil) }
7
- it('raises missing argument error') { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
10
+ it('raises missing argument error') { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
8
11
  end
9
12
 
10
13
  context 'when valid site id provided' do
@@ -1,13 +1,15 @@
1
1
  # frozen_string_literal: true
2
+ require 'spec_helpers/client'
3
+
2
4
  RSpec.describe FinApps::REST::Institutions do
3
- let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
5
+ include SpecHelpers::Client
4
6
 
5
7
  describe '#list' do
6
8
  subject(:institutions) { FinApps::REST::Institutions.new(client) }
7
9
 
8
10
  context 'when search_term is missing' do
9
11
  let(:list) { subject.list(nil) }
10
- it { expect { list }.to raise_error(FinApps::MissingArgumentsError) }
12
+ it { expect { list }.to raise_error(FinAppsCore::MissingArgumentsError) }
11
13
  end
12
14
 
13
15
  context 'when proper search_term is provided' do
@@ -1,20 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe FinApps::REST::OrderReports do
3
- let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
3
+ let(:client) { FinApps::REST::Client.new(:company_token) }
4
4
  describe '#show' do
5
5
  context 'when missing id' do
6
6
  subject { FinApps::REST::OrderReports.new(client).show(nil, :pdf) }
7
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
7
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
8
8
  end
9
9
 
10
10
  context 'when missing format' do
11
11
  subject { FinApps::REST::OrderReports.new(client).show(:valid_id, nil) }
12
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
12
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
13
13
  end
14
14
 
15
15
  context 'when invalid format is provided' do
16
16
  subject { FinApps::REST::OrderReports.new(client).show(:valid_id, :xml) }
17
- it { expect { subject }.to raise_error(FinApps::InvalidArgumentsError) }
17
+ it { expect { subject }.to raise_error(FinAppsCore::InvalidArgumentsError) }
18
18
  end
19
19
 
20
20
  context 'when valid params are provided' do
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe FinApps::REST::OrderStatuses do
3
- let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
3
+ include SpecHelpers::Client
4
+
4
5
  describe '#show' do
5
6
  context 'when missing id' do
6
7
  subject { FinApps::REST::OrderStatuses.new(client).show(nil) }
7
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
8
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
8
9
  end
9
10
 
10
11
  context 'when valid id is provided' do
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe FinApps::REST::OrderTokens, 'initialized with valid FinApps::Client object' do
3
3
  describe '#show' do
4
- client = FinApps::REST::Client.new :company_identifier, :company_token
4
+ include SpecHelpers::Client
5
+
5
6
  subject(:order_tokens) { FinApps::REST::OrderTokens.new(client) }
6
7
 
7
8
  context 'when missing token' do
8
- it { expect { subject.show(nil) }.to raise_error(FinApps::MissingArgumentsError, 'Missing argument: token.') }
9
+ it { expect { subject.show(nil) }.to raise_error(FinAppsCore::MissingArgumentsError, 'Missing argument: token') }
9
10
  end
10
11
 
11
12
  context 'for valid token' do
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe FinApps::REST::Orders do
3
- let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
3
+ include SpecHelpers::Client
4
+
4
5
  describe '#show' do
5
6
  context 'when missing params' do
6
7
  subject { FinApps::REST::Orders.new(client).show(nil) }
7
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
8
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
8
9
  end
9
10
 
10
11
  context 'when valid params are provided' do
@@ -20,7 +21,7 @@ RSpec.describe FinApps::REST::Orders do
20
21
  describe '#create' do
21
22
  context 'when missing params' do
22
23
  subject { FinApps::REST::Orders.new(client).create(nil) }
23
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
24
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
24
25
  end
25
26
 
26
27
  context 'when valid params are provided' do
@@ -71,12 +72,12 @@ RSpec.describe FinApps::REST::Orders do
71
72
 
72
73
  context 'when missing id' do
73
74
  let(:update) { subject.update(nil, :params) }
74
- it('returns missing argument error') { expect { update }.to raise_error(FinApps::MissingArgumentsError) }
75
+ it('returns missing argument error') { expect { update }.to raise_error(FinAppsCore::MissingArgumentsError) }
75
76
  end
76
77
 
77
78
  context 'when missing params' do
78
79
  let(:update) { subject.update(:id, nil) }
79
- it('returns missing argument error') { expect { update }.to raise_error(FinApps::MissingArgumentsError) }
80
+ it('returns missing argument error') { expect { update }.to raise_error(FinAppsCore::MissingArgumentsError) }
80
81
  end
81
82
 
82
83
  context 'when valid id and params are provided' do
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe FinApps::REST::PasswordResets do
3
- let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
3
+ include SpecHelpers::Client
4
4
 
5
5
  describe '#create' do
6
6
  context 'when missing id' do
7
7
  subject { FinApps::REST::PasswordResets.new(client).create(nil) }
8
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
8
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
9
9
  end
10
10
 
11
11
  context 'when invalid id is provided' do
@@ -32,12 +32,12 @@ RSpec.describe FinApps::REST::PasswordResets do
32
32
 
33
33
  context 'when missing id' do
34
34
  subject { FinApps::REST::PasswordResets.new(client).update(nil, :params) }
35
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
35
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
36
36
  end
37
37
 
38
38
  context 'when missing params' do
39
39
  subject { FinApps::REST::PasswordResets.new(client).update(:valid_user_id, nil) }
40
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
40
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
41
41
  end
42
42
 
43
43
  context 'when invalid id is provided' do
@@ -14,11 +14,11 @@ RSpec.describe FinApps::REST::Sessions, 'initialized with valid FinApps::Client
14
14
  message = 'Invalid argument: params.'
15
15
  it do
16
16
  expect { subject.create(email: nil, password: 'password') }
17
- .to raise_error(FinApps::InvalidArgumentsError, message)
17
+ .to raise_error(FinAppsCore::InvalidArgumentsError, message)
18
18
  end
19
19
  it do
20
20
  expect { subject.create(email: 'email', password: nil) }
21
- .to raise_error(FinApps::InvalidArgumentsError, message)
21
+ .to raise_error(FinAppsCore::InvalidArgumentsError, message)
22
22
  end
23
23
  end
24
24
 
@@ -1,10 +1,13 @@
1
1
  # frozen_string_literal: true
2
+ require 'spec_helpers/client'
3
+
2
4
  RSpec.describe FinApps::REST::UserInstitutionsForms do
3
- let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
5
+ include SpecHelpers::Client
6
+
4
7
  describe '#show' do
5
8
  context 'when missing site id' do
6
9
  subject { FinApps::REST::UserInstitutionsForms.new(client).show(nil) }
7
- it('raises missing argument error') { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
10
+ it('raises missing argument error') { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
8
11
  end
9
12
 
10
13
  context 'when valid site id provided' do
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe FinApps::REST::UserInstitutions do
3
- let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
3
+ include SpecHelpers::Client
4
+
4
5
  describe '#list' do
5
6
  context 'when successful' do
6
7
  subject { FinApps::REST::UserInstitutions.new(client).list }
@@ -16,12 +17,12 @@ RSpec.describe FinApps::REST::UserInstitutions do
16
17
 
17
18
  context 'when missing site_id' do
18
19
  let(:create) { subject.create(nil, :params) }
19
- it { expect { create }.to raise_error(FinApps::MissingArgumentsError) }
20
+ it { expect { create }.to raise_error(FinAppsCore::MissingArgumentsError) }
20
21
  end
21
22
 
22
23
  context 'when missing params' do
23
24
  let(:create) { subject.create(:site_id, nil) }
24
- it { expect { create }.to raise_error(FinApps::MissingArgumentsError) }
25
+ it { expect { create }.to raise_error(FinAppsCore::MissingArgumentsError) }
25
26
  end
26
27
 
27
28
  context 'when valid site_id and params are provided' do
@@ -38,7 +39,7 @@ RSpec.describe FinApps::REST::UserInstitutions do
38
39
  describe '#show' do
39
40
  context 'when missing id' do
40
41
  subject { FinApps::REST::UserInstitutions.new(client).show(nil) }
41
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
42
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
42
43
  end
43
44
 
44
45
  context 'when valid id is provided' do
@@ -62,12 +63,12 @@ RSpec.describe FinApps::REST::UserInstitutions do
62
63
  describe '#mfa_update' do
63
64
  context 'when missing id' do
64
65
  subject { FinApps::REST::UserInstitutions.new(client).mfa_update(nil, :params) }
65
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
66
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
66
67
  end
67
68
 
68
69
  context 'when missing params' do
69
70
  subject { FinApps::REST::UserInstitutions.new(client).mfa_update(:id, nil) }
70
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
71
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
71
72
  end
72
73
 
73
74
  context 'when valid id and params are provided' do
@@ -90,12 +91,12 @@ RSpec.describe FinApps::REST::UserInstitutions do
90
91
  describe '#credentials_update' do
91
92
  context 'when missing id' do
92
93
  subject { FinApps::REST::UserInstitutions.new(client).credentials_update(nil, :params) }
93
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
94
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
94
95
  end
95
96
 
96
97
  context 'when missing params' do
97
98
  subject { FinApps::REST::UserInstitutions.new(client).credentials_update(:id, nil) }
98
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
99
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
99
100
  end
100
101
 
101
102
  context 'when valid id and params are provided' do
@@ -118,7 +119,7 @@ RSpec.describe FinApps::REST::UserInstitutions do
118
119
  describe '#destroy' do
119
120
  context 'when missing id' do
120
121
  subject { FinApps::REST::UserInstitutions.new(client).destroy(nil) }
121
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
122
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
122
123
  end
123
124
 
124
125
  context 'when valid id is provided' do
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe FinApps::REST::UserInstitutionsStatuses do
3
- let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
3
+ include SpecHelpers::Client
4
+
4
5
  describe '#show' do
5
6
  context 'when missing id' do
6
7
  subject { FinApps::REST::UserInstitutionsStatuses.new(client).show(nil) }
7
- it { expect { subject }.to raise_error(FinApps::MissingArgumentsError) }
8
+ it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
8
9
  end
9
10
 
10
11
  context 'when valid id is provided' do
@@ -4,11 +4,11 @@ require 'spec_helpers/client'
4
4
  RSpec.describe FinApps::REST::Users, 'initialized with valid FinApps::Client object' do
5
5
  include SpecHelpers::Client
6
6
  subject(:users) { FinApps::REST::Users.new(client) }
7
- missing_public_id = 'Missing argument: public_id.'
7
+ missing_public_id = 'Missing argument: public_id'
8
8
 
9
9
  describe '#show' do
10
10
  context 'when missing public_id' do
11
- it { expect { subject.show(nil) }.to raise_error(FinApps::MissingArgumentsError, missing_public_id) }
11
+ it { expect { subject.show(nil) }.to raise_error(FinAppsCore::MissingArgumentsError, missing_public_id) }
12
12
  end
13
13
 
14
14
  context 'for valid public_id' do
@@ -35,7 +35,7 @@ RSpec.describe FinApps::REST::Users, 'initialized with valid FinApps::Client obj
35
35
 
36
36
  describe '#update' do
37
37
  context 'when missing public_id' do
38
- it { expect { subject.update(nil, {}) }.to raise_error(FinApps::MissingArgumentsError, missing_public_id) }
38
+ it { expect { subject.update(nil, {}) }.to raise_error(FinAppsCore::MissingArgumentsError, missing_public_id) }
39
39
  end
40
40
 
41
41
  context 'when updating user details' do
@@ -88,7 +88,7 @@ RSpec.describe FinApps::REST::Users, 'initialized with valid FinApps::Client obj
88
88
 
89
89
  describe '#destroy' do
90
90
  context 'when missing public_id' do
91
- it { expect { subject.destroy(nil) }.to raise_error(FinApps::MissingArgumentsError, missing_public_id) }
91
+ it { expect { subject.destroy(nil) }.to raise_error(FinAppsCore::MissingArgumentsError, missing_public_id) }
92
92
  end
93
93
 
94
94
  context 'for valid public_id' do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  RSpec.describe FinApps::REST::Version do
3
- let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
3
+ include SpecHelpers::Client
4
4
 
5
5
  subject { FinApps::REST::Version.new(client) }
6
6
  describe '#show' do
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
  if ENV['CODECLIMATE_REPO_TOKEN']
3
- require 'codeclimate-test-reporter'
4
- CodeClimate::TestReporter.start
3
+ # require 'codeclimate-test-reporter'
4
+ # CodeClimate::TestReporter.start
5
+ require 'simplecov'
6
+ SimpleCov.start
5
7
  end
6
8
 
7
9
  require 'bundler/setup'
@@ -27,7 +29,7 @@ RSpec.configure do |config|
27
29
  Kernel.srand config.seed
28
30
 
29
31
  config.before(:each) do
30
- base_url = "#{FinApps::REST::Defaults::DEFAULTS[:host]}/v#{FinApps::REST::Defaults::API_VERSION}/"
32
+ base_url = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v#{FinAppsCore::REST::Defaults::API_VERSION}/"
31
33
  stub_request(:any, /#{base_url}/).to_rack(::FakeApi)
32
34
  end
33
35
  WebMock.disable_net_connect!(allow: 'codeclimate.com')