roqua-rom-api 3.0.1 → 3.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 477f788af8448ee3fa2a41f20352eef3328dc09e712671437db727ea80da013d
4
- data.tar.gz: 5067b2d36c85318641c47dfc7f7ae53e52257448b5de0fcf66ed4f2b928b6c06
3
+ metadata.gz: 31364e35a8825ce3b39017a914af7cb91bca38ae29b4d42eec882dbba02dfa22
4
+ data.tar.gz: b78743c4a03b42d069ce3c56f8c807d8768a37d06e6dae28f553fa816c16a99c
5
5
  SHA512:
6
- metadata.gz: 17dd22e0f74ec2d4e47e816f0f7d103691ce14266411ce3db3f140a363e4c24c0c9c4a3b72329b8d90aa61b652914555392474e14b8f4081a7c0bbc43c50c30b
7
- data.tar.gz: edfd436ed08cc2df027f8369d54f1d056c02fdcb7d1279aef3f7bddc7ef75d3deffc213c1bc7858d79501c97de820c39f76ef818ef1aec93dad7d2b982dd8471
6
+ metadata.gz: 7dd680aa99c9757caafb5af382e813818fa986bc27f6c8cbb4b36d38b27aa13c31135cbc2eb89a2416571c1089a74bd73a75892161b25ef31d70bba91f268b51
7
+ data.tar.gz: 3a85d40c4f565d055569bfb1f9b571ce5b8886888b25210dd4c4ae4d275396a5637b24c04e618489b4de96c2ca8aad33b22b83d427e3fed3726c931d39276d81
@@ -18,13 +18,14 @@ module Roqua
18
18
  end
19
19
 
20
20
  def filter_params
21
- {response_ids: response_ids,
22
- respondent_type: respondent_type,
23
- status: status,
24
- questionnaire_keys: questionnaire_keys,
25
- completed_after: completed_after,
26
- completed_before: completed_before,
27
- protocol_subscription_id: protocol_subscription_id
21
+ {
22
+ response_ids: response_ids,
23
+ respondent_type: respondent_type,
24
+ status: status,
25
+ questionnaire_keys: questionnaire_keys,
26
+ completed_after: completed_after,
27
+ completed_before: completed_before,
28
+ protocol_subscription_id: protocol_subscription_id
28
29
  }.keep_if { |_k, v| v.present? }
29
30
  end
30
31
 
@@ -15,8 +15,8 @@ module Roqua
15
15
  attribute :questions, Hash
16
16
  attribute :scores, Hash
17
17
  attribute :sbg_info, Hash
18
- attribute :textvars, Hash
19
- attribute :flags, Hash
18
+ attribute :textvars, Array
19
+ attribute :flags, Array
20
20
  attribute :charts, Array
21
21
  end
22
22
  end
@@ -3,8 +3,8 @@ require 'roqua/rom_api/sessions/basic_auth_session'
3
3
 
4
4
  module Roqua
5
5
  module RomApi
6
- def self.basic_auth_session(*arguments, &block)
7
- Sessions::BasicAuthSession.new(*arguments, &block)
6
+ def self.basic_auth_session(...)
7
+ Sessions::BasicAuthSession.new(...)
8
8
  end
9
9
  end
10
10
  end
@@ -1,5 +1,5 @@
1
1
  module Roqua
2
2
  module RomApi
3
- VERSION = '3.0.1'
3
+ VERSION = '3.0.2'
4
4
  end
5
5
  end
@@ -17,7 +17,7 @@ describe ListDossierStats do
17
17
  describe 'with epd_ids provided' do
18
18
  let(:response) { {'foo' => {}, 'bar' => {}} }
19
19
  before do
20
- allow(session).to receive(:get).with('/stats', epd_ids: ['foo', 'bar']).and_return httparty_response(response)
20
+ allow(session).to receive(:get).with('/stats', {epd_ids: ['foo', 'bar']}).and_return httparty_response(response)
21
21
  end
22
22
 
23
23
  subject { ListDossierStats.run! epd_ids: ['foo', 'bar'] }
@@ -8,14 +8,14 @@ describe ListResponses do
8
8
  before { allow(BasicAuthSession).to receive(:new).and_return session }
9
9
 
10
10
  it 'performs a GET on the responses API' do
11
- expect(session).to receive(:get).with(api_path,
12
- respondent_type: 'respondent_type',
13
- status: :status,
14
- questionnaire_keys: ['questionnaire_key'],
15
- completed_after: Time.new(2014, 1, 1),
16
- completed_before: Time.new(2014, 1, 31),
17
- protocol_subscription_id: 'protocol_subscription_id')
18
- .and_return response
11
+ expect(session).to receive(:get).with(api_path, {
12
+ respondent_type: 'respondent_type',
13
+ status: :status,
14
+ questionnaire_keys: ['questionnaire_key'],
15
+ completed_after: Time.new(2014, 1, 1),
16
+ completed_before: Time.new(2014, 1, 31),
17
+ protocol_subscription_id: 'protocol_subscription_id'
18
+ }).and_return response
19
19
  ListResponses.run(dossier_id: options[:dossier_id],
20
20
  respondent_type: 'respondent_type',
21
21
  status: :status,
@@ -26,7 +26,7 @@ describe ListResponses do
26
26
  end
27
27
 
28
28
  it 'can get responses by id' do
29
- expect(session).to receive(:get).with(api_path, response_ids: ['1', '5', '7'])
29
+ expect(session).to receive(:get).with(api_path, {response_ids: ['1', '5', '7']})
30
30
  .and_return response
31
31
  ListResponses.run!(dossier_id: options[:dossier_id],
32
32
  response_ids: ['1', '5', '7'])
@@ -37,7 +37,7 @@ describe ReportCalculations do
37
37
  completed_after: filters[:completed_after].to_i,
38
38
  completed_before: filters[:completed_before].to_i
39
39
  }
40
- expect(session).to receive(:get).with(api_path, calculator: 'test', filters: filter_hash)
40
+ expect(session).to receive(:get).with(api_path, {calculator: 'test', filters: filter_hash})
41
41
  subject
42
42
  end
43
43
  end
@@ -11,24 +11,26 @@ describe StartProtocolSubscription do
11
11
  end
12
12
 
13
13
  it 'does a post to the rom protocol_subscription api' do
14
- expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions",
15
- protocol_key: options[:protocol_key],
16
- protocol_id: options[:protocol_id],
17
- respondent_id: options[:respondent_id],
18
- flags: {some_flag: true},
19
- textvars: {some_var: 'string'})
14
+ expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions", {
15
+ protocol_key: options[:protocol_key],
16
+ protocol_id: options[:protocol_id],
17
+ respondent_id: options[:respondent_id],
18
+ flags: {"some_flag" => true},
19
+ textvars: {"some_var" => 'string'}
20
+ })
20
21
  StartProtocolSubscription.run!(options)
21
22
  end
22
23
 
23
24
  it 'passes in the start_at option when provided' do
24
25
  start_at = Time.current
25
- expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions",
26
- protocol_key: options[:protocol_key],
27
- protocol_id: options[:protocol_id],
28
- respondent_id: options[:respondent_id],
29
- start_at: start_at.to_i,
30
- flags: {some_flag: true},
31
- textvars: {some_var: 'string'})
26
+ expect(session).to receive(:post).with("/dossiers/#{options[:dossier_id]}/protocol_subscriptions", {
27
+ protocol_key: options[:protocol_key],
28
+ protocol_id: options[:protocol_id],
29
+ respondent_id: options[:respondent_id],
30
+ start_at: start_at.to_i,
31
+ flags: {"some_flag" => true},
32
+ textvars: {"some_var" => 'string'}
33
+ })
32
34
  StartProtocolSubscription.run!(options.merge start_at: start_at)
33
35
  end
34
36
 
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: 3.0.1
4
+ version: 3.0.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: 2022-10-10 00:00:00.000000000 Z
15
+ date: 2023-11-21 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: httparty
@@ -160,20 +160,6 @@ dependencies:
160
160
  - - "~>"
161
161
  - !ruby/object:Gem::Version
162
162
  version: '2.9'
163
- - !ruby/object:Gem::Dependency
164
- name: ruby_dep
165
- requirement: !ruby/object:Gem::Requirement
166
- requirements:
167
- - - "~>"
168
- - !ruby/object:Gem::Version
169
- version: '1.5'
170
- type: :development
171
- prerelease: false
172
- version_requirements: !ruby/object:Gem::Requirement
173
- requirements:
174
- - - "~>"
175
- - !ruby/object:Gem::Version
176
- version: '1.5'
177
163
  description: Provides authenticated access to ROM utilities
178
164
  email: support@roqua.nl
179
165
  executables: []
@@ -274,39 +260,39 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
260
  - !ruby/object:Gem::Version
275
261
  version: '0'
276
262
  requirements: []
277
- rubygems_version: 3.1.4
263
+ rubygems_version: 3.4.19
278
264
  signing_key:
279
265
  specification_version: 4
280
266
  summary: API wrapper gem around RoQua's ROM API
281
267
  test_files:
282
- - spec/spec_helper.rb
283
- - spec/support/test.yml
284
- - spec/support/httparty_helpers.rb
285
268
  - spec/fabricators/basic_auth_session_fabricator.rb
286
- - spec/lib/roqua/rom_api/list_respondents_spec.rb
287
- - spec/lib/roqua/rom_api/update_response_spec.rb
269
+ - spec/lib/roqua/rom_api/cancel_fill_out_request_spec.rb
288
270
  - spec/lib/roqua/rom_api/create_fill_out_request_spec.rb
271
+ - spec/lib/roqua/rom_api/create_response_spec.rb
289
272
  - spec/lib/roqua/rom_api/endpoint_spec.rb
290
- - spec/lib/roqua/rom_api/get_respondent_spec.rb
273
+ - spec/lib/roqua/rom_api/get_measurement_spec.rb
274
+ - spec/lib/roqua/rom_api/get_non_response_spec.rb
291
275
  - spec/lib/roqua/rom_api/get_protocol_spec.rb
292
- - spec/lib/roqua/rom_api/stop_protocol_subscription_spec.rb
276
+ - spec/lib/roqua/rom_api/get_respondent_spec.rb
277
+ - spec/lib/roqua/rom_api/list_dossier_stats_spec.rb
293
278
  - spec/lib/roqua/rom_api/list_non_responses_spec.rb
294
- - spec/lib/roqua/rom_api/create_response_spec.rb
279
+ - spec/lib/roqua/rom_api/list_protocol_subscriptions_spec.rb
280
+ - spec/lib/roqua/rom_api/list_protocols_spec.rb
281
+ - spec/lib/roqua/rom_api/list_respondents_spec.rb
295
282
  - spec/lib/roqua/rom_api/list_responses_spec.rb
296
- - spec/lib/roqua/rom_api/report_calculations_spec.rb
297
- - spec/lib/roqua/rom_api/cancel_fill_out_request_spec.rb
298
- - spec/lib/roqua/rom_api/get_non_response_spec.rb
299
- - spec/lib/roqua/rom_api/models/stats_spec.rb
300
283
  - spec/lib/roqua/rom_api/models/dossier_stats_spec.rb
301
- - spec/lib/roqua/rom_api/models/respondent_spec.rb
302
284
  - spec/lib/roqua/rom_api/models/fill_out_request_spec.rb
303
- - spec/lib/roqua/rom_api/models/response_spec.rb
304
285
  - spec/lib/roqua/rom_api/models/protocol_subscription_spec.rb
286
+ - spec/lib/roqua/rom_api/models/respondent_spec.rb
287
+ - spec/lib/roqua/rom_api/models/response_spec.rb
288
+ - spec/lib/roqua/rom_api/models/stats_spec.rb
289
+ - spec/lib/roqua/rom_api/report_calculations_spec.rb
305
290
  - spec/lib/roqua/rom_api/sessions/basic_auth_session_spec.rb
306
291
  - spec/lib/roqua/rom_api/start_fill_out_session_spec.rb
307
- - spec/lib/roqua/rom_api/list_protocols_spec.rb
308
292
  - spec/lib/roqua/rom_api/start_protocol_subscription_spec.rb
309
- - spec/lib/roqua/rom_api/get_measurement_spec.rb
310
- - spec/lib/roqua/rom_api/list_protocol_subscriptions_spec.rb
311
- - spec/lib/roqua/rom_api/list_dossier_stats_spec.rb
293
+ - spec/lib/roqua/rom_api/stop_protocol_subscription_spec.rb
294
+ - spec/lib/roqua/rom_api/update_response_spec.rb
312
295
  - spec/lib/roqua_rom_api_spec.rb
296
+ - spec/spec_helper.rb
297
+ - spec/support/httparty_helpers.rb
298
+ - spec/support/test.yml