caseblocks_api 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.8
1
+ 0.2.9
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "caseblocks_api"
8
- s.version = "0.2.8"
8
+ s.version = "0.2.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mark Provan"]
12
- s.date = "2013-01-11"
12
+ s.date = "2013-01-17"
13
13
  s.email = "development@emergeadapt.com"
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE.txt",
@@ -7,22 +7,22 @@ module CaseblocksAPI
7
7
  @client = client
8
8
  end
9
9
 
10
- def execute_single(case_type, property_name, value)
11
- @client.get("/case_blocks/#{case_type}", {query: {search: true, property: property_name, value: value}})
10
+ def execute_single(case_type, property_name, value, page, page_size)
11
+ @client.get("/case_blocks/#{case_type}", {query: {search: true, property: property_name, value: value, page: page, page_size: page_size}})
12
12
  end
13
13
 
14
- def execute_multiple(case_type, properties)
15
- @client.post("/case_blocks/#{case_type}", :body => {search: true, properties: properties}.to_json)
14
+ def execute_multiple(case_type, properties, page, page_size)
15
+ @client.post("/case_blocks/#{case_type}", :body => {search: true, properties: properties, page: page, page_size: page_size }.to_json)
16
16
  end
17
17
  end
18
18
 
19
19
  class Client
20
- def find_by_property(case_type, property_name, value)
21
- Finder.new(self.class).execute_single(case_type, property_name, value)
20
+ def find_by_property(case_type, property_name, value, page, page_size)
21
+ Finder.new(self.class).execute_single(case_type, property_name, value, page, page_size)
22
22
  end
23
23
 
24
- def find_by_properties(case_type, properties)
25
- Finder.new(self.class).execute_multiple(case_type, properties)
24
+ def find_by_properties(case_type, properties, page, page_size)
25
+ Finder.new(self.class).execute_multiple(case_type, properties, page, page_size)
26
26
  end
27
27
  end
28
28
  end
@@ -9,19 +9,23 @@ describe CaseblocksAPI::Finder do
9
9
  context "find by a single property" do
10
10
  Given (:property_name) { "order_number" }
11
11
  Given (:value) { "2000391" }
12
+ Given (:page) { "0" }
13
+ Given (:page_size) { "100" }
12
14
  Given (:find_by_property) { CaseblocksAPI::Finder.new(client) }
13
- When (:result) { find_by_property.execute_single(case_type, property_name, value) }
15
+ When (:result) { find_by_property.execute_single(case_type, property_name, value, page, page_size) }
14
16
  Then { expect(result).to eql client.result}
15
17
  Then { expect(client.requested_url).to eql "/case_blocks/#{case_type}" }
16
- Then { expect(client.params).to eql({query: {search: true, property: property_name, value: value}}) }
18
+ Then { expect(client.params).to eql({query: {search: true, property: property_name, value: value, page: page, page_size: page_size}}) }
17
19
  end
18
20
 
19
21
  context "finding by multiple properties" do
20
22
  Given (:properties) { {order_number: '12334', client_surname: 'Smith'} }
23
+ Given (:page) { "0" }
24
+ Given (:page_size) { "100" }
21
25
  Given (:find_by_properties) { CaseblocksAPI::Finder.new(client) }
22
- When (:result) { find_by_properties.execute_multiple(case_type, properties) }
26
+ When (:result) { find_by_properties.execute_multiple(case_type, properties, page, page_size) }
23
27
  Then { expect(client.requested_url).to eql "/case_blocks/#{case_type}" }
24
- Then { expect(client.params).to eql({body: {search: true, properties: properties}.to_json}) }
28
+ Then { expect(client.params).to eql({body: {search: true, properties: properties, page: page, page_size: page_size}.to_json}) }
25
29
  end
26
30
 
27
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caseblocks_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-11 00:00:00.000000000 Z
12
+ date: 2013-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -215,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
215
  version: '0'
216
216
  segments:
217
217
  - 0
218
- hash: -1573686528482834911
218
+ hash: 451976357356511242
219
219
  required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  none: false
221
221
  requirements: