bank_credentials 0.1.7 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -0
- data/bank_credentials.gemspec +3 -2
- data/lib/bank_credentials/hbci.rb +30 -0
- data/lib/bank_credentials/version.rb +1 -1
- data/lib/bank_list.json +4068 -0
- data/spec/bank_credentials/hbci_spec.rb +20 -2
- data/spec/spec_helper.rb +1 -0
- metadata +21 -6
@@ -16,9 +16,27 @@ describe BankCredentials::Hbci do
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
describe '#url' do
|
20
|
+
let(:credential_hash) do
|
21
|
+
{
|
22
|
+
bank_code: '10020890',
|
23
|
+
user_id: 'user_id',
|
24
|
+
pin: 'pin'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
subject { described_class.new(credential_hash) }
|
29
|
+
|
30
|
+
context 'with valid bank list' do
|
31
|
+
it 'returns endpoint url' do
|
32
|
+
expect(subject.url).to eql('https://hbci-01.hypovereinsbank.de/bank/hbci')
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
19
37
|
describe '#valid?' do
|
20
38
|
it 'returns false when one of the keys is missing' do
|
21
|
-
%i[
|
39
|
+
%i[bank_code user_id pin].each do |key|
|
22
40
|
expect(described_class.new(credential_hash.merge!(key => nil))).to_not be_valid
|
23
41
|
end
|
24
42
|
end
|
@@ -30,7 +48,7 @@ describe BankCredentials::Hbci do
|
|
30
48
|
|
31
49
|
describe 'validate!' do
|
32
50
|
it 'raises an error when one of the keys is missing' do
|
33
|
-
%i[
|
51
|
+
%i[bank_code user_id pin].each do |key|
|
34
52
|
subject = described_class.new(credential_hash.merge!(key => nil), validate: false)
|
35
53
|
expect { subject.validate! }.to raise_error(BankCredentials::Hbci::Errors::Invalid)
|
36
54
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bank_credentials
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Lehnert
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '10'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '10'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '12.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '12.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.4'
|
69
83
|
description: Encapsulates and validates the completeness of banking credentials for
|
70
84
|
ebics and hbci.
|
71
85
|
email:
|
@@ -94,6 +108,7 @@ files:
|
|
94
108
|
- lib/bank_credentials/factory.rb
|
95
109
|
- lib/bank_credentials/hbci.rb
|
96
110
|
- lib/bank_credentials/version.rb
|
111
|
+
- lib/bank_list.json
|
97
112
|
- spec/bank_credentials/base_spec.rb
|
98
113
|
- spec/bank_credentials/ebics_spec.rb
|
99
114
|
- spec/bank_credentials/errors_spec.rb
|