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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTEwYmQ0ZjQzOTBiZDlmOTM4NThjY2QyNjc5NzMwNjk1MDE3ODcyZg==
4
+ Mjg5MmRlNTY3ZmYzYTQ4YzQ0M2VjYWNkMmQ5MmEwNDFkOWMyM2IxYg==
5
5
  data.tar.gz: !binary |-
6
- MzYzZTE4ZGY0MmJhZTE0YzI2MWVhOTE0OTY5MjBmMzI2MTk0YjlmYw==
6
+ ZDljMzlmODYzMmYyNzc0M2U0Njk0ZDRjN2JiOGVhZmFmMjYyZTU0MA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzM4M2ExYjA0Yzk4YmFhODQ5MzJjNWNhZGYzZDM5ZTcxZTUzODllMWI2MGFk
10
- ZTgxYmNmMmMzN2ZkNWI1MTI2NjY0YTFkN2E3YTVlNWFlYzY5OTE5MzUxZTRl
11
- ZjU3ZmVmYTdlOTJhMzAzMmFlYjg2NDQxZDBhZDBlNGY4NzIzMzI=
9
+ YTRmNjExNmZmZGEzMjhhNmZhMzQ1NWU2NmYxZDhmZWI4YTI3ZDQ0Nzk1ODA3
10
+ OWY5YTg1YzgzNjkwZjljZWUwNGU0ZjNhOTc0MTc1NDUwYmU2MDZiZjE2M2Rj
11
+ YjgyYjBmZTIxMTNlYTBhMTlmN2FjZjJhZDkwMjU3NWI3NzU4YWI=
12
12
  data.tar.gz: !binary |-
13
- NmQzNjgzODM4MTlmYjg5ZTMwNWYyYmU2ODE5ZTY2OWYzYzBhNDJkNmU3ZmZi
14
- MjAzN2RkMmI0MTRkNWE1NTcwY2VhZjQ4YTk4NDc5NjkxYTEwM2VkODY1N2Jk
15
- ZmYyZDNkYTk0MzljZmM5YmJkZDYwNjJiYjdhNGY4NDU1N2UzNDA=
13
+ OTczOTE4NjE3MGYwYzQ4Nzc4OWRmNmRiYmQxY2EyOWNlYmNiOGZkOWMxNjMw
14
+ NjE0MjRjZWEzZDQ2NDkzYzEzNWFhNTg5ZmM4ZjU1NDRmMjZmMGI4ZWFlZjZl
15
+ OTk2N2FlZGI2ZDRmODNkNmMwZjQ5MzZkMjMzZTc1NzE4ZDU5ZjM=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blueline_services (0.2.0)
4
+ blueline_services (0.3.0)
5
5
  activesupport
6
6
  httparty
7
7
  i18n
@@ -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 = HTTParty.post(base_uri, :body => {:request => to_xml})
146
+ response = build_request.perform
136
147
  data = response.parsed_response
137
148
  BluelineServices::Response.new(data)
138
149
  end
@@ -1,3 +1,3 @@
1
1
  module BluelineServices
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -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.expects(:post).with(subject.base_uri, body).returns(http_response)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blueline_services
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Karna