roqua-rom-api 0.4.1 → 0.4.2
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 +4 -4
- data/ChangeLog.md +6 -0
- data/lib/roqua/rom_api/cancel_fill_out_request.rb +1 -1
- data/lib/roqua/rom_api/create_fill_out_request.rb +2 -2
- data/lib/roqua/rom_api/create_measurement_sequence.rb +2 -2
- data/lib/roqua/rom_api/create_response.rb +5 -5
- data/lib/roqua/rom_api/endpoint.rb +4 -0
- data/lib/roqua/rom_api/get_questionnaire.rb +1 -1
- data/lib/roqua/rom_api/list_dossier_stats.rb +1 -1
- data/lib/roqua/rom_api/list_protocol_subscriptions.rb +1 -1
- data/lib/roqua/rom_api/list_responses.rb +1 -1
- data/lib/roqua/rom_api/report_calculations.rb +1 -1
- data/lib/roqua/rom_api/start_fill_out_session.rb +6 -6
- data/lib/roqua/rom_api/start_protocol_subscription.rb +1 -1
- data/lib/roqua/rom_api/stop_protocol_subscription.rb +1 -1
- data/lib/roqua/rom_api/update_response.rb +5 -5
- data/lib/roqua/rom_api/version.rb +1 -1
- data/spec/lib/roqua/rom_api/endpoint_spec.rb +15 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 535a4b60c45368785c54db8ea787cb7c55ae76ea
|
4
|
+
data.tar.gz: 3136d9448c04008760acdb583e32a14664515d67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b14d68dc7d170cf45fecbac5b6c2cee25fd476195734cdf9b44a3da5ff1fb14c15353278ea15e043df81d9a4cb8060e89937623baaddcf58b2f3ecb63402e25
|
7
|
+
data.tar.gz: 1f88c54aacb92fb083e1dccd5e82deba0d534d6b95ad48fa4e9766c83745a854a3db98b871b33dcba8200eec47b79d10da834d2809c2361c694cd128934187ac
|
data/ChangeLog.md
CHANGED
@@ -7,7 +7,7 @@ module Roqua
|
|
7
7
|
|
8
8
|
def execute
|
9
9
|
validate_response_for do
|
10
|
-
|
10
|
+
basic_auth_session.delete("/dossiers/#{dossier_id}/fill_out_requests/#{fill_out_request_id}")
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -22,8 +22,8 @@ module Roqua
|
|
22
22
|
open_from: open_from && open_from.to_i,
|
23
23
|
open_till: open_till && open_till.to_i
|
24
24
|
}.keep_if { |_k, v| v.present? }
|
25
|
-
|
26
|
-
|
25
|
+
basic_auth_session.post("/dossiers/#{dossier_id}/fill_out_requests",
|
26
|
+
fill_out_request: fill_out_request)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -8,8 +8,8 @@ module Roqua
|
|
8
8
|
|
9
9
|
def execute
|
10
10
|
validate_response_for do
|
11
|
-
|
12
|
-
|
11
|
+
basic_auth_session.post("/dossiers/#{dossier_id}/measurement_sequences",
|
12
|
+
measurement_sequence: {flags: flags, textvars: textvars})
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -10,11 +10,11 @@ module Roqua
|
|
10
10
|
|
11
11
|
def execute
|
12
12
|
validate_response_for do
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
basic_auth_session.post "/dossiers/#{dossier_id}/responses",
|
14
|
+
questionnaire_key: questionnaire_key,
|
15
|
+
answer_data: answer_data,
|
16
|
+
filled_out_at: (filled_out_at.to_i if filled_out_at),
|
17
|
+
respondent: respondent
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -13,12 +13,12 @@ module Roqua
|
|
13
13
|
|
14
14
|
def execute
|
15
15
|
validate_response_for do
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
basic_auth_session.post("/dossiers/#{dossier_id}/fill_out_sessions",
|
17
|
+
questionnaire_keys: questionnaire_keys,
|
18
|
+
response_ids: response_ids,
|
19
|
+
return_to: return_to,
|
20
|
+
progress_url: progress_url,
|
21
|
+
stylesheet: stylesheet)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -12,7 +12,7 @@ module Roqua
|
|
12
12
|
options = {protocol_key: protocol_key, flags: flags, textvars: textvars}
|
13
13
|
options[:start_at] = start_at.to_i if start_at
|
14
14
|
validate_response_for do
|
15
|
-
|
15
|
+
basic_auth_session.post("/dossiers/#{dossier_id}/protocol_subscriptions", options)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -7,7 +7,7 @@ module Roqua
|
|
7
7
|
|
8
8
|
def execute
|
9
9
|
validate_response_for do
|
10
|
-
|
10
|
+
basic_auth_session.delete("/dossiers/#{dossier_id}/protocol_subscriptions/#{protocol_subscription_id}")
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -11,11 +11,11 @@ module Roqua
|
|
11
11
|
|
12
12
|
def execute
|
13
13
|
validate_response_for do
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
basic_auth_session.patch "/dossiers/#{dossier_id}/responses/#{id}",
|
15
|
+
questionnaire_key: questionnaire_key,
|
16
|
+
answer_data: answer_data,
|
17
|
+
filled_out_at: (filled_out_at.to_i if filled_out_at),
|
18
|
+
started_at: (started_at.to_i if started_at)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -15,6 +15,21 @@ describe Endpoint do
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
describe '#initialize' do
|
19
|
+
it 'calls RomApi.basic_auth_session to fill in basic_auth_session if the basic_auth_session is not passed in' do
|
20
|
+
bas_double = Roqua::RomApi::Sessions::BasicAuthSession.new # doubles dont pass AI default type checking
|
21
|
+
allow(Roqua::RomApi).to receive(:basic_auth_session).and_return bas_double
|
22
|
+
endpoint = TestEndpoint.new
|
23
|
+
expect(endpoint.instance_variable_get :@basic_auth_session).to eq(bas_double)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'sets basic_auth_session to the passed basic_auth_session' do
|
27
|
+
bas_double = double("BasicAuthSession")
|
28
|
+
endpoint = TestEndpoint.new(basic_auth_session: bas_double)
|
29
|
+
expect(endpoint.instance_variable_get :@basic_auth_session).to eq(bas_double)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
18
33
|
describe 'with validations' do
|
19
34
|
let(:response) do
|
20
35
|
double('httparty_repsonse', code: 200, parsed_response: {}).tap do |response|
|
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.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Esposito
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2015-08-
|
15
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: httparty
|
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
214
|
version: '0'
|
215
215
|
requirements: []
|
216
216
|
rubyforge_project:
|
217
|
-
rubygems_version: 2.
|
217
|
+
rubygems_version: 2.2.2
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
220
|
summary: API wrapper gem around RoQua's ROM API
|