blueline_services 0.2.0 → 0.3.0
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 +8 -8
- data/Gemfile.lock +1 -1
- data/lib/blueline_services/request.rb +12 -1
- data/lib/blueline_services/version.rb +1 -1
- data/test/unit/request_test.rb +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Mjg5MmRlNTY3ZmYzYTQ4YzQ0M2VjYWNkMmQ5MmEwNDFkOWMyM2IxYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDljMzlmODYzMmYyNzc0M2U0Njk0ZDRjN2JiOGVhZmFmMjYyZTU0MA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTRmNjExNmZmZGEzMjhhNmZhMzQ1NWU2NmYxZDhmZWI4YTI3ZDQ0Nzk1ODA3
|
10
|
+
OWY5YTg1YzgzNjkwZjljZWUwNGU0ZjNhOTc0MTc1NDUwYmU2MDZiZjE2M2Rj
|
11
|
+
YjgyYjBmZTIxMTNlYTBhMTlmN2FjZjJhZDkwMjU3NWI3NzU4YWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTczOTE4NjE3MGYwYzQ4Nzc4OWRmNmRiYmQxY2EyOWNlYmNiOGZkOWMxNjMw
|
14
|
+
NjE0MjRjZWEzZDQ2NDkzYzEzNWFhNTg5ZmM4ZjU1NDRmMjZmMGI4ZWFlZjZl
|
15
|
+
OTk2N2FlZGI2ZDRmODNkNmMwZjQ5MzZkMjMzZTc1NzE4ZDU5ZjM=
|
data/Gemfile.lock
CHANGED
@@ -131,8 +131,19 @@ module BluelineServices
|
|
131
131
|
as_xml.to_xml
|
132
132
|
end
|
133
133
|
|
134
|
+
def request_options
|
135
|
+
{
|
136
|
+
body: { request: to_xml },
|
137
|
+
basic_auth: { username: user_name, password: password }
|
138
|
+
}
|
139
|
+
end
|
140
|
+
|
141
|
+
def build_request
|
142
|
+
HTTParty::Request.new(Net::HTTP::Post, base_uri, request_options)
|
143
|
+
end
|
144
|
+
|
134
145
|
def submit
|
135
|
-
response =
|
146
|
+
response = build_request.perform
|
136
147
|
data = response.parsed_response
|
137
148
|
BluelineServices::Response.new(data)
|
138
149
|
end
|
data/test/unit/request_test.rb
CHANGED
@@ -70,9 +70,8 @@ module BluelineServices
|
|
70
70
|
request_xml = "request xml"
|
71
71
|
response_xml = "reponse_xml"
|
72
72
|
http_response = mock(:parsed_response => response_xml)
|
73
|
-
body = {:body => {:request => request_xml}}
|
74
73
|
subject.expects(:to_xml).returns(request_xml)
|
75
|
-
HTTParty.
|
74
|
+
HTTParty::Request.any_instance.stubs(perform: http_response)
|
76
75
|
Response.expects(:new).with(response_xml).returns(response)
|
77
76
|
assert_equal response, subject.submit
|
78
77
|
end
|