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.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -18
- data/.ruby-gemset +1 -1
- data/.travis.yml +5 -2
- data/README.md +1 -1
- data/finapps.gemspec +10 -12
- data/lib/finapps.rb +5 -21
- data/lib/finapps/rest/client.rb +42 -53
- data/lib/finapps/rest/institutions.rb +2 -2
- data/lib/finapps/rest/institutions_forms.rb +2 -2
- data/lib/finapps/rest/order_reports.rb +4 -4
- data/lib/finapps/rest/order_statuses.rb +2 -2
- data/lib/finapps/rest/order_tokens.rb +2 -3
- data/lib/finapps/rest/orders.rb +6 -6
- data/lib/finapps/rest/password_resets.rb +4 -4
- data/lib/finapps/rest/sessions.rb +2 -2
- data/lib/finapps/rest/user_institutions.rb +21 -26
- data/lib/finapps/rest/user_institutions_forms.rb +2 -2
- data/lib/finapps/rest/user_institutions_statuses.rb +2 -2
- data/lib/finapps/rest/users.rb +5 -5
- data/lib/finapps/rest/version.rb +1 -1
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/client_spec.rb +4 -13
- data/spec/rest/institutions_forms_spec.rb +5 -2
- data/spec/rest/institutions_spec.rb +4 -2
- data/spec/rest/order_reports_spec.rb +4 -4
- data/spec/rest/order_statuses_spec.rb +3 -2
- data/spec/rest/order_tokens_spec.rb +3 -2
- data/spec/rest/orders_spec.rb +6 -5
- data/spec/rest/password_resets_spec.rb +4 -4
- data/spec/rest/sessions_spec.rb +2 -2
- data/spec/rest/user_institutions_forms_spec.rb +5 -2
- data/spec/rest/user_institutions_spec.rb +10 -9
- data/spec/rest/user_institutions_statuses_spec.rb +3 -2
- data/spec/rest/users_spec.rb +4 -4
- data/spec/rest/version_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -3
- data/spec/spec_helpers/client.rb +1 -1
- metadata +49 -124
- data/lib/core_extensions/hash/compact.rb +0 -23
- data/lib/core_extensions/object/blank.rb +0 -69
- data/lib/core_extensions/object/is_integer.rb +0 -10
- data/lib/core_extensions/string/json_to_hash.rb +0 -10
- data/lib/finapps/error.rb +0 -17
- data/lib/finapps/middleware/middleware.rb +0 -22
- data/lib/finapps/middleware/request/accept_json.rb +0 -14
- data/lib/finapps/middleware/request/no_encoding_basic_authentication.rb +0 -21
- data/lib/finapps/middleware/request/tenant_authentication.rb +0 -20
- data/lib/finapps/middleware/request/user_agent.rb +0 -15
- data/lib/finapps/middleware/response/custom_logger.rb +0 -41
- data/lib/finapps/middleware/response/raise_error.rb +0 -46
- data/lib/finapps/rest/base_client.rb +0 -122
- data/lib/finapps/rest/configuration.rb +0 -31
- data/lib/finapps/rest/connection.rb +0 -35
- data/lib/finapps/rest/credentials.rb +0 -21
- data/lib/finapps/rest/defaults.rb +0 -80
- data/lib/finapps/rest/resources.rb +0 -64
- data/lib/finapps/utils/loggeable.rb +0 -14
- data/lib/finapps/utils/parameter_filter.rb +0 -32
- data/spec/core_extensions/hash/compact_spec.rb +0 -21
- data/spec/core_extensions/object/is_integer_spec.rb +0 -17
- data/spec/middleware/request/accept_json_spec.rb +0 -12
- data/spec/middleware/request/no_encoding_basic_authentication_spec.rb +0 -32
- data/spec/middleware/request/tenant_authentication_spec.rb +0 -34
- data/spec/middleware/request/user_agent_spec.rb +0 -12
- data/spec/middleware/response/raise_error_spec.rb +0 -24
- data/spec/rest/base_client_spec.rb +0 -120
- data/spec/rest/configuration_spec.rb +0 -39
- data/spec/rest/credentials_spec.rb +0 -20
- data/spec/rest/resources_spec.rb +0 -76
- data/spec/rest/timeout_spec.rb +0 -9
- data/spec/support/fixtures/relevance_ruleset_names.json +0 -47
- 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 <
|
4
|
+
class UserInstitutionsForms < FinAppsCore::REST::Resources
|
5
5
|
using ObjectExtensions
|
6
6
|
using StringExtensions
|
7
7
|
|
8
8
|
def show(id)
|
9
|
-
|
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 <
|
4
|
+
class UserInstitutionsStatuses < FinAppsCore::REST::Resources # :nodoc:
|
5
5
|
using ObjectExtensions
|
6
6
|
using StringExtensions
|
7
7
|
|
8
8
|
def show(id)
|
9
|
-
|
9
|
+
not_blank(id, :id)
|
10
10
|
|
11
11
|
path = "institutions/user/#{ERB::Util.url_encode(id)}/status"
|
12
12
|
super id, path
|
data/lib/finapps/rest/users.rb
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module FinApps
|
3
3
|
module REST
|
4
|
-
class Users <
|
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
|
-
|
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
|
-
|
19
|
-
|
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
|
-
|
26
|
+
not_blank(public_id, :public_id)
|
27
27
|
super public_id
|
28
28
|
end
|
29
29
|
|
data/lib/finapps/rest/version.rb
CHANGED
data/lib/finapps/version.rb
CHANGED
data/spec/rest/client_spec.rb
CHANGED
@@ -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
|
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(:
|
10
|
+
subject { FinApps::REST::Client.new(:company_token) }
|
15
11
|
|
16
|
-
|
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
|
-
|
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
|
-
|
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(
|
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
|
-
|
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(
|
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(:
|
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(
|
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(
|
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(
|
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
|
-
|
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(
|
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
|
-
|
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(
|
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
|
data/spec/rest/orders_spec.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec.describe FinApps::REST::Orders do
|
3
|
-
|
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(
|
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(
|
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(
|
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(
|
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
|
-
|
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(
|
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(
|
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(
|
40
|
+
it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
41
41
|
end
|
42
42
|
|
43
43
|
context 'when invalid id is provided' do
|
data/spec/rest/sessions_spec.rb
CHANGED
@@ -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(
|
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(
|
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
|
-
|
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(
|
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
|
-
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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
|
-
|
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(
|
8
|
+
it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
|
8
9
|
end
|
9
10
|
|
10
11
|
context 'when valid id is provided' do
|
data/spec/rest/users_spec.rb
CHANGED
@@ -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(
|
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(
|
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(
|
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
|
data/spec/rest/version_spec.rb
CHANGED
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 = "#{
|
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')
|