roqua-rom-api 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16fc5f0f04495f71a7a5658cdcd60939d44b7d89
4
- data.tar.gz: ff78fb08b0c1fe66a2745c38f376d0c79068e759
3
+ metadata.gz: 9dabec741f6720854b9fa8a54c4bf4810111ffd7
4
+ data.tar.gz: 6a1df4977729a20a1154ef4525bf36f39e3772ee
5
5
  SHA512:
6
- metadata.gz: 24e8e9bad8b0c40ee0a1ce2bc4b1b6595ac3af61823f8160dacbe2309a4a32e9c4c837ce707824746dc83eca74dcc9be00d7794ed1d82626d429b440b2e31761
7
- data.tar.gz: c3cd6a83c3b7806db832b30ae6cb701633ec4742c8a6ebdc969e85218064d7769e4327bac72ba81959d5b1591d28efde0d7e65671765b6b0fcd9fdd3eb402b53
6
+ metadata.gz: 590dd708649de58c19626ab1c28c370d15087715dd2ff1496f869b24cbd57875d2c4963ba2d28eb82328bb001b4ef53ab4812b572d8794506e53e6d1aad8ac0e
7
+ data.tar.gz: f7be56cfc8cc587fcf8f0f8e527c47ead80890aa04b0182a96ddd1f2b9a73869b39956750bec3dff3c40a267be2eedd7c474d1e7c649822e235c40251810ec17
data/ChangeLog.md CHANGED
@@ -1,4 +1,8 @@
1
- ##$ 0.0.5 / 2014-03-12
1
+ ### 0.0.6 / 2014-03-12
2
+
3
+ * Fix ProtocolSubscription api return value
4
+
5
+ ### 0.0.5 / 2014-03-12
2
6
 
3
7
  * Remove RoQua prefix from env vars
4
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roqua-rom-api (0.0.5)
4
+ roqua-rom-api (0.0.6)
5
5
  active_interaction (~> 1.0.4)
6
6
  httparty (~> 0.12.0)
7
7
 
@@ -10,9 +10,7 @@ module Roqua
10
10
  options = {dossier_id: dossier_id,
11
11
  protocol_key: protocol_key}
12
12
  options[:start_at] = start_at.to_i if start_at
13
- response = RomApi.basic_auth_session.post '/protocol_subscriptions', options
14
- fail response.parsed_response.inspect unless (200..299).include? response.code
15
- response
13
+ RomApi.basic_auth_session.post('/protocol_subscriptions', options).parsed_response
16
14
  end
17
15
  end
18
16
  end
@@ -1,5 +1,5 @@
1
1
  module Roqua
2
2
  module RomApi
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
  end
5
5
  end
@@ -3,13 +3,17 @@ require 'spec_helper'
3
3
  describe StartProtocolSubscription do
4
4
  let(:options) { {dossier_id: 'some_dossier_id', protocol_key: 'some_key'} }
5
5
  let(:session) { Sessions::BasicAuthSession.new }
6
- before { allow(Sessions::BasicAuthSession).to receive(:new).and_return session }
6
+ let(:parsed_response) { double('parsed_response') }
7
+ let(:response) { double('response', parsed_response: parsed_response) }
8
+ before do
9
+ allow(Sessions::BasicAuthSession).to receive(:new).and_return session
10
+ allow(session).to receive(:post).and_return response
11
+ end
7
12
 
8
13
  it 'does a post to the rom protocol_subscription api' do
9
14
  expect(session).to receive(:post).with('/protocol_subscriptions', dossier_id: options[:dossier_id],
10
15
  protocol_key: options[:protocol_key])
11
- .and_return double('response', code: 200)
12
- StartProtocolSubscription.run(options)
16
+ StartProtocolSubscription.run!(options)
13
17
  end
14
18
 
15
19
  it 'passes in the start_at option when provided' do
@@ -17,12 +21,10 @@ describe StartProtocolSubscription do
17
21
  expect(session).to receive(:post).with('/protocol_subscriptions', dossier_id: options[:dossier_id],
18
22
  protocol_key: options[:protocol_key],
19
23
  start_at: start_at.to_i)
20
- .and_return double('response', code: 200)
21
- StartProtocolSubscription.run(options.merge start_at: start_at)
24
+ StartProtocolSubscription.run!(options.merge start_at: start_at)
22
25
  end
23
26
 
24
- it 'raises when the response HTTP status is not in the 200 range' do
25
- allow(session).to receive(:post).and_return double('response', code: 401)
26
- expect { StartProtocolSubscription.run(options) }.to raise_error
27
+ it 'returns the parsed response' do
28
+ expect(StartProtocolSubscription.run!(options)).to eq(parsed_response)
27
29
  end
28
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roqua-rom-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Esposito