roqua-rom-api 0.0.5 → 0.0.6
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,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dabec741f6720854b9fa8a54c4bf4810111ffd7
|
4
|
+
data.tar.gz: 6a1df4977729a20a1154ef4525bf36f39e3772ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 590dd708649de58c19626ab1c28c370d15087715dd2ff1496f869b24cbd57875d2c4963ba2d28eb82328bb001b4ef53ab4812b572d8794506e53e6d1aad8ac0e
|
7
|
+
data.tar.gz: f7be56cfc8cc587fcf8f0f8e527c47ead80890aa04b0182a96ddd1f2b9a73869b39956750bec3dff3c40a267be2eedd7c474d1e7c649822e235c40251810ec17
|
data/ChangeLog.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -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
|
-
|
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
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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 '
|
25
|
-
|
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
|