soaspec 0.0.75 → 0.0.76
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +7 -0
- data/lib/soaspec/exchange.rb +7 -4
- data/lib/soaspec/test_server/get_bank.rb +3 -2
- data/lib/soaspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c81bc329ff3d5ea409f8842d6de0d4435584a7b
|
4
|
+
data.tar.gz: db52504cab243e4bce49dcf3e6d594cf017eb543
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c4344b6b2de4ff083ae273740698e1bdc4f203db777bc133183e75110a79089fee3676551a384fba82f8edfa3c92b7b6211d55857471179e440b2450ec2905a
|
7
|
+
data.tar.gz: 7ab42d4c4e2e347b1856d37ca4accd6d2168949500be62a69bba0fa50c822cd208c96deb41c338ed50544f636e8531d1af647ebcabf2cb888da58b961d7cb7e0
|
data/ChangeLog
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
Version 0.0.76
|
2
|
+
* Bug fix
|
3
|
+
* Fixed BLZService scenario on soaspec-virtual-server
|
4
|
+
* Fixed return value for retry_for_success failure
|
5
|
+
* Enhancements
|
6
|
+
* Added method to indicate a factory create should actually return a failure status
|
7
|
+
|
1
8
|
Version 0.0.75
|
2
9
|
* Enhancements
|
3
10
|
* For Factory created methods, set retry_for_success to true. Allow for this to be set at Exchange class level
|
data/lib/soaspec/exchange.rb
CHANGED
@@ -39,6 +39,8 @@ class Exchange
|
|
39
39
|
attr_accessor :retry_count
|
40
40
|
# Name used for displaying class
|
41
41
|
attr_accessor :test_name
|
42
|
+
# Expect Factory to fail upon trying to create
|
43
|
+
attr_writer :fail_factory
|
42
44
|
|
43
45
|
# Set retry for success variable to true so that request will be retried
|
44
46
|
# for retry_count until it's true
|
@@ -80,6 +82,7 @@ class Exchange
|
|
80
82
|
# As a last resort this uses the global parameter. The handler should be set straight before an exchange is made to use this
|
81
83
|
@exchange_handler ||= default_handler_used || Soaspec.api_handler
|
82
84
|
raise '@exchange_handler not set. Set either with `Soaspec.api_handler = Handler.new` or within the exchange' unless @exchange_handler
|
85
|
+
@fail_factory = nil
|
83
86
|
@override_parameters = override_parameters
|
84
87
|
@retry_for_success = false
|
85
88
|
self.retry_count = 3
|
@@ -104,11 +107,11 @@ class Exchange
|
|
104
107
|
def make_request
|
105
108
|
Soaspec::SpecLogger.add_to 'Example ' + test_name
|
106
109
|
request_params = @override_parameters
|
107
|
-
retry_count.
|
108
|
-
response =
|
110
|
+
(1..retry_count).each do |count|
|
111
|
+
response = exchange_handler.make_request(request_params)
|
109
112
|
return response unless retry_for_success?
|
110
113
|
return response if (200..299).cover? @exchange_handler.status_code_for(response)
|
111
|
-
response
|
114
|
+
break response if count == retry_count
|
112
115
|
end
|
113
116
|
end
|
114
117
|
|
@@ -212,7 +215,7 @@ class Exchange
|
|
212
215
|
# Used by FactoryBot
|
213
216
|
# @return [Self]
|
214
217
|
def save!
|
215
|
-
@retry_for_success =
|
218
|
+
@retry_for_success = @fail_factory ? false : true
|
216
219
|
call
|
217
220
|
self
|
218
221
|
end
|
@@ -144,8 +144,9 @@ module Soaspec
|
|
144
144
|
blz_element = doc.at_xpath('//tns:blz')
|
145
145
|
return 500, error_response_template unless blz_element
|
146
146
|
@bank_name = blz_element.inner_text
|
147
|
-
|
148
|
-
|
147
|
+
@bank_id = @bank_name.to_i
|
148
|
+
return 500, ERB.new(bank_not_found).result(binding) if @bank_id.zero?
|
149
|
+
@title = 'DAB Bank' if @bank_id == 500
|
149
150
|
ERB.new(success_response_template).result(binding)
|
150
151
|
end
|
151
152
|
|
data/lib/soaspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.76
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|