constructorio 2.0.12 → 2.0.13

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
- SHA1:
3
- metadata.gz: ab196a51451afa8b2a68fb497909a74c4564b837
4
- data.tar.gz: a5481b715838f451ca12235c008411057a37f366
2
+ SHA256:
3
+ metadata.gz: 2ca3e31d09af72a9dec708d345fd8ea2f22cc64e2623e3a4205de1bf841e17a2
4
+ data.tar.gz: e38e090bb932ca4238e51047fc453dadb2117dc5cc9838514cc082379f884df2
5
5
  SHA512:
6
- metadata.gz: 3997f3da91ebe0a3ed47854d3c7a65cbc36756f2f8caae51522133d81823f8adb09225b38b5b192c8a5f34a60b1aa296f99a9d09fd158d0d3d919dad7f6eeecd
7
- data.tar.gz: c809327cd71fd37797303f69b391701e245bf2ab353fad5543f9fa52c935ec56cca15073a3967a0debc1396b728b6eadb65935ab9fc0a0ea72493bf8c5b49689
6
+ metadata.gz: 85b0abb3888259d2db059f941aadb985136f58c197055d60e917dc614ff7cab03c9d838badb7611adfc12d5b63de6f11db383a561cb19b6ca6659f9f883e3071
7
+ data.tar.gz: 1f399b18dd1d2bea7f402f6c1090fedeeb1fd6caa9084b61824aa98576f5220f031eacdcd21303174b9801952dad82820cca71115ab7d65e4aca0b944fe83d6c
data/README.md CHANGED
@@ -14,7 +14,7 @@ And then execute:
14
14
 
15
15
  Or install it yourself:
16
16
 
17
- $ gem install customerio
17
+ $ gem install constructorio
18
18
 
19
19
  ## Usage
20
20
 
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'faraday', '~> 0.9', '>= 0.9.0'
21
+ spec.add_dependency 'faraday', '~> 1.0', '>= 1.0'
22
22
  spec.add_development_dependency "bundler", "~> 1.7"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
24
  spec.add_development_dependency 'pry', '~> 0.10', '>= 0.10.1'
@@ -1,3 +1,3 @@
1
1
  module ConstructorIO
2
- VERSION = "2.0.12"
2
+ VERSION = "2.0.13"
3
3
  end
@@ -10,6 +10,6 @@ class ConfigurationTest < MiniTest::Test
10
10
  end
11
11
 
12
12
  def test_configure_api_url
13
- assert_equal ConstructorIO.configuration.api_url, "https://devac.cnstrc.com"
13
+ assert_equal ConstructorIO.configuration.api_url, "https://ac.cnstrc.com"
14
14
  end
15
15
  end
@@ -13,7 +13,18 @@ class ConstructorIOVCRTest < MiniTest::Test
13
13
 
14
14
  VCR.use_cassette("add_item") do
15
15
  response = c.add(
16
- { item_name: "power_drill", autocomplete_section: "standard" }
16
+ { item_name: "power_drill", autocomplete_section: "Search Suggestions" }
17
+ )
18
+ assert_equal response.status, 204
19
+ end
20
+ end
21
+
22
+ def test_add_item_with_metadata
23
+ c = ConstructorIO::Client.new
24
+
25
+ VCR.use_cassette("add_item_with_metadata") do
26
+ response = c.add(
27
+ { item_name: "power_drill", autocomplete_section: "Products", url: "/condition/1", metadata: { key1: "value1", key2: "value2" } }
17
28
  )
18
29
  assert_equal response.status, 204
19
30
  end
@@ -24,7 +35,7 @@ class ConstructorIOVCRTest < MiniTest::Test
24
35
 
25
36
  VCR.use_cassette("add_or_update_item") do
26
37
  response = c.add_or_update(
27
- { item_name: "power_drill", autocomplete_section: "standard" }
38
+ { item_name: "power_drill", autocomplete_section: "Search Suggestions" }
28
39
  )
29
40
  assert_equal response.status, 204
30
41
  end
@@ -35,7 +46,7 @@ class ConstructorIOVCRTest < MiniTest::Test
35
46
 
36
47
  VCR.use_cassette("add_batch") do
37
48
  response = c.add_batch(
38
- autocomplete_section: "standard",
49
+ autocomplete_section: "Search Suggestions",
39
50
  items: [
40
51
  { item_name: "power drill x11" },
41
52
  { item_name: "power drill x12" },
@@ -47,12 +58,28 @@ class ConstructorIOVCRTest < MiniTest::Test
47
58
  end
48
59
  end
49
60
 
61
+ def test_add_batch_with_metadata
62
+ c = ConstructorIO::Client.new
63
+
64
+ VCR.use_cassette("add_batch_with_metadata") do
65
+ response = c.add_batch(
66
+ autocomplete_section: "Products",
67
+ items: [
68
+ { item_name: "power_drill 1", url: "/condition/1", metadata: { key1: "value1", key2: "value2" } },
69
+ { item_name: "power_drill 2", url: "/condition/2", metadata: { key3: "value3", key4: "value4" } },
70
+ { item_name: "power_drill 3", url: "/condition/3", metadata: { key5: "value5", key6: "value6" } }
71
+ ]
72
+ )
73
+ assert_equal response.status, 204
74
+ end
75
+ end
76
+
50
77
  def test_add_or_update_batch
51
78
  c = ConstructorIO::Client.new
52
79
 
53
80
  VCR.use_cassette("add_or_update_batch") do
54
81
  response = c.add_or_update_batch(
55
- autocomplete_section: "standard",
82
+ autocomplete_section: "Search Suggestions",
56
83
  items: [
57
84
  { item_name: "power drill x1" },
58
85
  { item_name: "power drill x2" },
@@ -69,7 +96,7 @@ class ConstructorIOVCRTest < MiniTest::Test
69
96
 
70
97
  VCR.use_cassette("remove_item") do
71
98
  response = c.remove(
72
- { item_name: "power_drill", autocomplete_section: "standard" }
99
+ { item_name: "power_drill", autocomplete_section: "Search Suggestions" }
73
100
  )
74
101
  assert_equal response.status, 204
75
102
  end
@@ -80,7 +107,7 @@ class ConstructorIOVCRTest < MiniTest::Test
80
107
 
81
108
  VCR.use_cassette("remove_batch") do
82
109
  response = c.remove_batch(
83
- autocomplete_section: "standard",
110
+ autocomplete_section: "Search Suggestions",
84
111
  items: [
85
112
  { item_name: "power_drill x1" },
86
113
  { item_name: "power_drill x2" },
@@ -97,7 +124,7 @@ class ConstructorIOVCRTest < MiniTest::Test
97
124
 
98
125
  VCR.use_cassette("modify_item") do
99
126
  response = c.remove(
100
- { item_name: "power_drill", autocomplete_section: "standard", suggested_score: 10 }
127
+ { item_name: "power_drill", autocomplete_section: "Search Suggestions", suggested_score: 10 }
101
128
  )
102
129
  assert_equal response.status, 204
103
130
  end
@@ -2,11 +2,11 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://example_api_token:@devac.cnstrc.com/v1/batch_items?autocomplete_key=example_autocomplete_key
5
+ uri: https://example_api_token:@ac.cnstrc.com/v1/batch_items?autocomplete_key=example_autocomplete_key
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"autocomplete_section":"standard","items":[{"item_name":"power drill
9
- x11"},{"item_name":"power drill x12"},{"item_name":"power drill x13"},{"item_name":"power
8
+ string: '{"autocomplete_section":"Search Suggestions","items":[{"item_name":"power
9
+ drill x11"},{"item_name":"power drill x12"},{"item_name":"power drill x13"},{"item_name":"power
10
10
  drill x14"}]}'
11
11
  headers:
12
12
  User-Agent:
@@ -31,23 +31,23 @@ http_interactions:
31
31
  Content-Type:
32
32
  - text/html; charset=utf-8
33
33
  Date:
34
- - Tue, 07 Jun 2016 03:39:56 GMT
34
+ - Wed, 16 Nov 2016 05:06:53 GMT
35
35
  Server:
36
36
  - nginx/1.4.6 (Ubuntu)
37
37
  Set-Cookie:
38
- - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRkpQY1RkNGJGSnlOeTlzWXpaVFYzWkNjbFYyUkM1YVZqQXlZMjlUVVM5b05DNVZhRlJUVG5Bek5XSlZVVFZ0UXpobWNrd3kifX0.CjfTjA.o2g9zUSNBd574QtwB33OjGP20ZU;
38
+ - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRlY0YVVacFNpODFUa3hhWTJWaE5sQmtPRWxwU0M1MEwyeHhjME0zVFZkbFJFWm1hQzUzVmpSQ2RuSkhjbGhuVGxjdVIweHAifX0.Cw167Q.Jw-ZHw-7tRKVPOEBUp0-o4fXp58;
39
39
  HttpOnly; Path=/
40
40
  Strict-Transport-Security:
41
41
  - max-age=31536000
42
42
  Via:
43
43
  - 1.1 varnish
44
44
  X-Varnish:
45
- - '726243420'
45
+ - '1827964804'
46
46
  Connection:
47
47
  - keep-alive
48
48
  body:
49
49
  encoding: UTF-8
50
50
  string: ''
51
51
  http_version:
52
- recorded_at: Tue, 07 Jun 2016 03:39:56 GMT
52
+ recorded_at: Wed, 16 Nov 2016 05:06:53 GMT
53
53
  recorded_with: VCR 2.9.3
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://example_api_token:@ac.cnstrc.com/v1/batch_items?autocomplete_key=example_autocomplete_key
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"autocomplete_section":"Products","items":[{"item_name":"power_drill
9
+ 1","url":"/condition/1","metadata":{"key1":"value1","key2":"value2"}},{"item_name":"power_drill
10
+ 2","url":"/condition/2","metadata":{"key3":"value3","key4":"value4"}},{"item_name":"power_drill
11
+ 3","url":"/condition/3","metadata":{"key5":"value5","key6":"value6"}}]}'
12
+ headers:
13
+ User-Agent:
14
+ - Faraday v0.9.1
15
+ Content-Type:
16
+ - application/json
17
+ Accept-Encoding:
18
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
19
+ Accept:
20
+ - "*/*"
21
+ response:
22
+ status:
23
+ code: 204
24
+ message: NO CONTENT
25
+ headers:
26
+ Accept-Ranges:
27
+ - bytes
28
+ Age:
29
+ - '0'
30
+ Content-Length:
31
+ - '0'
32
+ Content-Type:
33
+ - text/html; charset=utf-8
34
+ Date:
35
+ - Wed, 16 Nov 2016 05:06:52 GMT
36
+ Server:
37
+ - nginx/1.4.6 (Ubuntu)
38
+ Set-Cookie:
39
+ - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRlY0YVVacFNpODFUa3hhWTJWaE5sQmtPRWxwU0M1MEwyeHhjME0zVFZkbFJFWm1hQzUzVmpSQ2RuSkhjbGhuVGxjdVIweHAifX0.Cw167A.J1MXRYqdpA5qlEKI0AfwHKspaJQ;
40
+ HttpOnly; Path=/
41
+ Strict-Transport-Security:
42
+ - max-age=31536000
43
+ Via:
44
+ - 1.1 varnish
45
+ X-Varnish:
46
+ - '739215592'
47
+ Connection:
48
+ - keep-alive
49
+ body:
50
+ encoding: UTF-8
51
+ string: ''
52
+ http_version:
53
+ recorded_at: Wed, 16 Nov 2016 05:06:52 GMT
54
+ recorded_with: VCR 2.9.3
@@ -2,10 +2,10 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://example_api_token:@devac.cnstrc.com/v1/item?autocomplete_key=example_autocomplete_key
5
+ uri: https://example_api_token:@ac.cnstrc.com/v1/item?autocomplete_key=example_autocomplete_key
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"item_name":"power_drill","autocomplete_section":"standard"}'
8
+ string: '{"item_name":"power_drill","autocomplete_section":"Search Suggestions"}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.9.1
@@ -29,23 +29,23 @@ http_interactions:
29
29
  Content-Type:
30
30
  - text/html; charset=utf-8
31
31
  Date:
32
- - Fri, 16 Oct 2015 16:31:30 GMT
32
+ - Wed, 16 Nov 2016 05:06:52 GMT
33
33
  Server:
34
34
  - nginx/1.4.6 (Ubuntu)
35
35
  Set-Cookie:
36
- - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRkpQY1RkNGJGSnlOeTlzWXpaVFYzWkNjbFYyUkM1YVZqQXlZMjlUVVM5b05DNVZhRlJUVG5Bek5XSlZVVFZ0UXpobWNrd3kifX0.CQK34g.J6XoEQJTyZV5ngAmVgSsYthAz0c;
36
+ - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRlY0YVVacFNpODFUa3hhWTJWaE5sQmtPRWxwU0M1MEwyeHhjME0zVFZkbFJFWm1hQzUzVmpSQ2RuSkhjbGhuVGxjdVIweHAifX0.Cw167A.J1MXRYqdpA5qlEKI0AfwHKspaJQ;
37
37
  HttpOnly; Path=/
38
38
  Strict-Transport-Security:
39
39
  - max-age=31536000
40
40
  Via:
41
41
  - 1.1 varnish
42
42
  X-Varnish:
43
- - '1717338774'
43
+ - '816986814'
44
44
  Connection:
45
45
  - keep-alive
46
46
  body:
47
47
  encoding: UTF-8
48
48
  string: ''
49
49
  http_version:
50
- recorded_at: Fri, 16 Oct 2015 16:31:27 GMT
50
+ recorded_at: Wed, 16 Nov 2016 05:06:52 GMT
51
51
  recorded_with: VCR 2.9.3
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://example_api_token:@ac.cnstrc.com/v1/item?autocomplete_key=example_autocomplete_key
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"item_name":"power_drill","autocomplete_section":"Products","url":"/condition/1","metadata":{"key1":"value1","key2":"value2"}}'
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Content-Type:
13
+ - application/json
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 204
21
+ message: NO CONTENT
22
+ headers:
23
+ Accept-Ranges:
24
+ - bytes
25
+ Age:
26
+ - '0'
27
+ Content-Length:
28
+ - '0'
29
+ Content-Type:
30
+ - text/html; charset=utf-8
31
+ Date:
32
+ - Wed, 16 Nov 2016 05:06:53 GMT
33
+ Server:
34
+ - nginx/1.4.6 (Ubuntu)
35
+ Set-Cookie:
36
+ - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRlY0YVVacFNpODFUa3hhWTJWaE5sQmtPRWxwU0M1MEwyeHhjME0zVFZkbFJFWm1hQzUzVmpSQ2RuSkhjbGhuVGxjdVIweHAifX0.Cw167Q.Jw-ZHw-7tRKVPOEBUp0-o4fXp58;
37
+ HttpOnly; Path=/
38
+ Strict-Transport-Security:
39
+ - max-age=31536000
40
+ Via:
41
+ - 1.1 varnish
42
+ X-Varnish:
43
+ - '739215594'
44
+ Connection:
45
+ - keep-alive
46
+ body:
47
+ encoding: UTF-8
48
+ string: ''
49
+ http_version:
50
+ recorded_at: Wed, 16 Nov 2016 05:06:53 GMT
51
+ recorded_with: VCR 2.9.3
@@ -2,11 +2,11 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: put
5
- uri: https://example_api_token:@devac.cnstrc.com/v1/batch_items?autocomplete_key=example_autocomplete_key&force=1
5
+ uri: https://example_api_token:@ac.cnstrc.com/v1/batch_items?autocomplete_key=example_autocomplete_key&force=1
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"autocomplete_section":"standard","items":[{"item_name":"power drill
9
- x1"},{"item_name":"power drill x2"},{"item_name":"power drill x3"},{"item_name":"power
8
+ string: '{"autocomplete_section":"Search Suggestions","items":[{"item_name":"power
9
+ drill x1"},{"item_name":"power drill x2"},{"item_name":"power drill x3"},{"item_name":"power
10
10
  drill x4"}]}'
11
11
  headers:
12
12
  User-Agent:
@@ -31,23 +31,23 @@ http_interactions:
31
31
  Content-Type:
32
32
  - text/html; charset=utf-8
33
33
  Date:
34
- - Tue, 07 Jun 2016 03:14:14 GMT
34
+ - Wed, 16 Nov 2016 05:06:53 GMT
35
35
  Server:
36
36
  - nginx/1.4.6 (Ubuntu)
37
37
  Set-Cookie:
38
- - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRkpQY1RkNGJGSnlOeTlzWXpaVFYzWkNjbFYyUkM1YVZqQXlZMjlUVVM5b05DNVZhRlJUVG5Bek5XSlZVVFZ0UXpobWNrd3kifX0.CjfNhg.8qcLG7yjDcmjumAfaKXGoX6vj1U;
38
+ - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRlY0YVVacFNpODFUa3hhWTJWaE5sQmtPRWxwU0M1MEwyeHhjME0zVFZkbFJFWm1hQzUzVmpSQ2RuSkhjbGhuVGxjdVIweHAifX0.Cw167Q.Jw-ZHw-7tRKVPOEBUp0-o4fXp58;
39
39
  HttpOnly; Path=/
40
40
  Strict-Transport-Security:
41
41
  - max-age=31536000
42
42
  Via:
43
43
  - 1.1 varnish
44
44
  X-Varnish:
45
- - '726242482'
45
+ - '816986817'
46
46
  Connection:
47
47
  - keep-alive
48
48
  body:
49
49
  encoding: UTF-8
50
50
  string: ''
51
51
  http_version:
52
- recorded_at: Tue, 07 Jun 2016 03:14:14 GMT
52
+ recorded_at: Wed, 16 Nov 2016 05:06:53 GMT
53
53
  recorded_with: VCR 2.9.3
@@ -2,10 +2,10 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: put
5
- uri: https://example_api_token:@devac.cnstrc.com/v1/item?autocomplete_key=example_autocomplete_key&force=1
5
+ uri: https://example_api_token:@ac.cnstrc.com/v1/item?autocomplete_key=example_autocomplete_key&force=1
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"item_name":"power_drill","autocomplete_section":"standard"}'
8
+ string: '{"item_name":"power_drill","autocomplete_section":"Search Suggestions"}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.9.1
@@ -29,23 +29,23 @@ http_interactions:
29
29
  Content-Type:
30
30
  - text/html; charset=utf-8
31
31
  Date:
32
- - Tue, 12 Apr 2016 21:55:33 GMT
32
+ - Wed, 16 Nov 2016 05:06:52 GMT
33
33
  Server:
34
34
  - nginx/1.4.6 (Ubuntu)
35
35
  Set-Cookie:
36
- - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRkpQY1RkNGJGSnlOeTlzWXpaVFYzWkNjbFYyUkM1YVZqQXlZMjlUVVM5b05DNVZhRlJUVG5Bek5XSlZVVFZ0UXpobWNrd3kifX0.Ce8AVQ.A1cD_4WU8OnFKDzeNthxB2f9B2E;
36
+ - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRlY0YVVacFNpODFUa3hhWTJWaE5sQmtPRWxwU0M1MEwyeHhjME0zVFZkbFJFWm1hQzUzVmpSQ2RuSkhjbGhuVGxjdVIweHAifX0.Cw167A.J1MXRYqdpA5qlEKI0AfwHKspaJQ;
37
37
  HttpOnly; Path=/
38
38
  Strict-Transport-Security:
39
39
  - max-age=31536000
40
40
  Via:
41
41
  - 1.1 varnish
42
42
  X-Varnish:
43
- - '205899122'
43
+ - '739215593'
44
44
  Connection:
45
45
  - keep-alive
46
46
  body:
47
47
  encoding: UTF-8
48
48
  string: ''
49
49
  http_version:
50
- recorded_at: Tue, 12 Apr 2016 21:55:33 GMT
50
+ recorded_at: Wed, 16 Nov 2016 05:06:52 GMT
51
51
  recorded_with: VCR 2.9.3
@@ -2,10 +2,10 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: delete
5
- uri: https://example_api_token:@devac.cnstrc.com/v1/item?autocomplete_key=example_autocomplete_key
5
+ uri: https://example_api_token:@ac.cnstrc.com/v1/item?autocomplete_key=example_autocomplete_key
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"item_name":"power_drill","autocomplete_section":"standard","suggested_score":10}'
8
+ string: '{"item_name":"power_drill","autocomplete_section":"Search Suggestions","suggested_score":10}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.9.1
@@ -29,23 +29,23 @@ http_interactions:
29
29
  Content-Type:
30
30
  - text/html; charset=utf-8
31
31
  Date:
32
- - Fri, 16 Oct 2015 16:32:45 GMT
32
+ - Wed, 16 Nov 2016 05:06:52 GMT
33
33
  Server:
34
34
  - nginx/1.4.6 (Ubuntu)
35
35
  Set-Cookie:
36
- - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRkpQY1RkNGJGSnlOeTlzWXpaVFYzWkNjbFYyUkM1YVZqQXlZMjlUVVM5b05DNVZhRlJUVG5Bek5XSlZVVFZ0UXpobWNrd3kifX0.CQK4LQ.pCfOTI1WpHfQS43FrXjaoC69dE4;
36
+ - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRlY0YVVacFNpODFUa3hhWTJWaE5sQmtPRWxwU0M1MEwyeHhjME0zVFZkbFJFWm1hQzUzVmpSQ2RuSkhjbGhuVGxjdVIweHAifX0.Cw167A.J1MXRYqdpA5qlEKI0AfwHKspaJQ;
37
37
  HttpOnly; Path=/
38
38
  Strict-Transport-Security:
39
39
  - max-age=31536000
40
40
  Via:
41
41
  - 1.1 varnish
42
42
  X-Varnish:
43
- - '1717338812'
43
+ - '1827964802'
44
44
  Connection:
45
45
  - keep-alive
46
46
  body:
47
47
  encoding: UTF-8
48
48
  string: ''
49
49
  http_version:
50
- recorded_at: Fri, 16 Oct 2015 16:32:42 GMT
50
+ recorded_at: Wed, 16 Nov 2016 05:06:52 GMT
51
51
  recorded_with: VCR 2.9.3
@@ -2,10 +2,10 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: delete
5
- uri: https://example_api_token:@devac.cnstrc.com/v1/batch_items?autocomplete_key=example_autocomplete_key
5
+ uri: https://example_api_token:@ac.cnstrc.com/v1/batch_items?autocomplete_key=example_autocomplete_key
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"autocomplete_section":"standard","items":[{"item_name":"power_drill
8
+ string: '{"autocomplete_section":"Search Suggestions","items":[{"item_name":"power_drill
9
9
  x1"},{"item_name":"power_drill x2"},{"item_name":"power_drill x3"},{"item_name":"power_drill
10
10
  x4"}]}'
11
11
  headers:
@@ -31,23 +31,23 @@ http_interactions:
31
31
  Content-Type:
32
32
  - text/html; charset=utf-8
33
33
  Date:
34
- - Tue, 07 Jun 2016 03:26:48 GMT
34
+ - Wed, 16 Nov 2016 05:06:54 GMT
35
35
  Server:
36
36
  - nginx/1.4.6 (Ubuntu)
37
37
  Set-Cookie:
38
- - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRkpQY1RkNGJGSnlOeTlzWXpaVFYzWkNjbFYyUkM1YVZqQXlZMjlUVVM5b05DNVZhRlJUVG5Bek5XSlZVVFZ0UXpobWNrd3kifX0.CjfQeA.iF5gfCJO-QeR65yv3bX96VJIYYE;
38
+ - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRlY0YVVacFNpODFUa3hhWTJWaE5sQmtPRWxwU0M1MEwyeHhjME0zVFZkbFJFWm1hQzUzVmpSQ2RuSkhjbGhuVGxjdVIweHAifX0.Cw167g.bIpQgiI5kG0qDYfl2X7PMJIq-H0;
39
39
  HttpOnly; Path=/
40
40
  Strict-Transport-Security:
41
41
  - max-age=31536000
42
42
  Via:
43
43
  - 1.1 varnish
44
44
  X-Varnish:
45
- - '726242940'
45
+ - '1827964805'
46
46
  Connection:
47
47
  - keep-alive
48
48
  body:
49
49
  encoding: UTF-8
50
50
  string: ''
51
51
  http_version:
52
- recorded_at: Tue, 07 Jun 2016 03:26:48 GMT
52
+ recorded_at: Wed, 16 Nov 2016 05:06:53 GMT
53
53
  recorded_with: VCR 2.9.3
@@ -2,10 +2,10 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: delete
5
- uri: https://example_api_token:@devac.cnstrc.com/v1/item?autocomplete_key=example_autocomplete_key
5
+ uri: https://example_api_token:@ac.cnstrc.com/v1/item?autocomplete_key=example_autocomplete_key
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"item_name":"power_drill","autocomplete_section":"standard"}'
8
+ string: '{"item_name":"power_drill","autocomplete_section":"Search Suggestions"}'
9
9
  headers:
10
10
  User-Agent:
11
11
  - Faraday v0.9.1
@@ -29,23 +29,23 @@ http_interactions:
29
29
  Content-Type:
30
30
  - text/html; charset=utf-8
31
31
  Date:
32
- - Fri, 16 Oct 2015 16:32:33 GMT
32
+ - Wed, 16 Nov 2016 05:06:51 GMT
33
33
  Server:
34
34
  - nginx/1.4.6 (Ubuntu)
35
35
  Set-Cookie:
36
- - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRkpQY1RkNGJGSnlOeTlzWXpaVFYzWkNjbFYyUkM1YVZqQXlZMjlUVVM5b05DNVZhRlJUVG5Bek5XSlZVVFZ0UXpobWNrd3kifX0.CQK4IQ.H03aEqDi2KY5OCpQiI02AdxSZ00;
36
+ - session=eyJwd19oYXNoIjp7IiBiIjoiSkRKaEpEQTRKRlY0YVVacFNpODFUa3hhWTJWaE5sQmtPRWxwU0M1MEwyeHhjME0zVFZkbFJFWm1hQzUzVmpSQ2RuSkhjbGhuVGxjdVIweHAifX0.Cw166w.0Z3Yfne0N19DLbcLyMC7q1rjvRU;
37
37
  HttpOnly; Path=/
38
38
  Strict-Transport-Security:
39
39
  - max-age=31536000
40
40
  Via:
41
41
  - 1.1 varnish
42
42
  X-Varnish:
43
- - '1717338807'
43
+ - '1827964801'
44
44
  Connection:
45
45
  - keep-alive
46
46
  body:
47
47
  encoding: UTF-8
48
48
  string: ''
49
49
  http_version:
50
- recorded_at: Fri, 16 Oct 2015 16:32:30 GMT
50
+ recorded_at: Wed, 16 Nov 2016 05:06:51 GMT
51
51
  recorded_with: VCR 2.9.3
data/test/test_helper.rb CHANGED
@@ -6,5 +6,5 @@ require_relative '../lib/constructorio'
6
6
  ConstructorIO.configure do |config|
7
7
  config.api_token = ENV['CONSTRUCTORIO_API_TOKEN'] || "example_api_token"
8
8
  config.autocomplete_key = ENV['CONSTRUCTORIO_AUTOCOMPLETE_KEY'] || "example_autocomplete_key"
9
- config.api_url = "https://devac.cnstrc.com"
9
+ config.api_url = "https://ac.cnstrc.com"
10
10
  end
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: constructorio
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.12
4
+ version: 2.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan McCormick
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '0.9'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 0.9.0
19
+ version: '1.0'
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '1.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '0.9'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
- version: 0.9.0
29
+ version: '1.0'
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -82,22 +82,22 @@ dependencies:
82
82
  name: mocha
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - "~>"
86
- - !ruby/object:Gem::Version
87
- version: '1.1'
88
85
  - - ">="
89
86
  - !ruby/object:Gem::Version
90
87
  version: 1.1.0
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '1.1'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '1.1'
98
95
  - - ">="
99
96
  - !ruby/object:Gem::Version
100
97
  version: 1.1.0
98
+ - - "~>"
99
+ - !ruby/object:Gem::Version
100
+ version: '1.1'
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: minitest
103
103
  requirement: !ruby/object:Gem::Requirement
@@ -170,8 +170,9 @@ files:
170
170
  - test/constructorio_vcr_test.rb
171
171
  - test/constructorio_vcr_test_errors.rb
172
172
  - test/fixtures/vcr_cassettes/add_batch.yml
173
+ - test/fixtures/vcr_cassettes/add_batch_with_metadata.yml
173
174
  - test/fixtures/vcr_cassettes/add_item.yml
174
- - test/fixtures/vcr_cassettes/add_item_error.yml
175
+ - test/fixtures/vcr_cassettes/add_item_with_metadata.yml
175
176
  - test/fixtures/vcr_cassettes/add_or_update_batch.yml
176
177
  - test/fixtures/vcr_cassettes/add_or_update_item.yml
177
178
  - test/fixtures/vcr_cassettes/modify_item.yml
@@ -182,7 +183,7 @@ homepage: http://constructor.io
182
183
  licenses:
183
184
  - MIT
184
185
  metadata: {}
185
- post_install_message:
186
+ post_install_message:
186
187
  rdoc_options: []
187
188
  require_paths:
188
189
  - lib
@@ -197,9 +198,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
198
  - !ruby/object:Gem::Version
198
199
  version: '0'
199
200
  requirements: []
200
- rubyforge_project:
201
- rubygems_version: 2.2.2
202
- signing_key:
201
+ rubygems_version: 3.0.8
202
+ signing_key:
203
203
  specification_version: 4
204
204
  summary: Ruby gem for Constructor.io
205
205
  test_files:
@@ -208,8 +208,9 @@ test_files:
208
208
  - test/constructorio_vcr_test.rb
209
209
  - test/constructorio_vcr_test_errors.rb
210
210
  - test/fixtures/vcr_cassettes/add_batch.yml
211
+ - test/fixtures/vcr_cassettes/add_batch_with_metadata.yml
211
212
  - test/fixtures/vcr_cassettes/add_item.yml
212
- - test/fixtures/vcr_cassettes/add_item_error.yml
213
+ - test/fixtures/vcr_cassettes/add_item_with_metadata.yml
213
214
  - test/fixtures/vcr_cassettes/add_or_update_batch.yml
214
215
  - test/fixtures/vcr_cassettes/add_or_update_item.yml
215
216
  - test/fixtures/vcr_cassettes/modify_item.yml
@@ -1,99 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://Bad%20token:@devac.cnstrc.com/v1/item?autocomplete_key=example_autocomplete_key
6
- body:
7
- encoding: UTF-8
8
- string: '{"item_name":"power_drill","autocomplete_section":"standard"}'
9
- headers:
10
- User-Agent:
11
- - Faraday v0.9.1
12
- Content-Type:
13
- - application/json
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Accept:
17
- - "*/*"
18
- response:
19
- status:
20
- code: 401
21
- message: UNAUTHORIZED
22
- headers:
23
- Accept-Ranges:
24
- - bytes
25
- Age:
26
- - '0'
27
- Content-Type:
28
- - application/json
29
- Date:
30
- - Fri, 16 Oct 2015 16:38:59 GMT
31
- Server:
32
- - nginx/1.4.6 (Ubuntu)
33
- Strict-Transport-Security:
34
- - max-age=31536000
35
- Via:
36
- - 1.1 varnish
37
- X-Varnish:
38
- - '1717338970'
39
- Content-Length:
40
- - '120'
41
- Connection:
42
- - keep-alive
43
- body:
44
- encoding: UTF-8
45
- string: |-
46
- {
47
- "message": "Invalid auth_token. If you've forgotten your token, you can generate a new one in the admin dashboard"
48
- }
49
- http_version:
50
- recorded_at: Fri, 16 Oct 2015 16:38:57 GMT
51
- - request:
52
- method: post
53
- uri: https://example_api_token:@devac.cnstrc.com/v1/item?autocomplete_key=bad_autocomplete_key
54
- body:
55
- encoding: UTF-8
56
- string: '{"item_name":"power_drill","autocomplete_section":"standard"}'
57
- headers:
58
- User-Agent:
59
- - Faraday v0.9.1
60
- Content-Type:
61
- - application/json
62
- Accept-Encoding:
63
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
64
- Accept:
65
- - "*/*"
66
- response:
67
- status:
68
- code: 401
69
- message: UNAUTHORIZED
70
- headers:
71
- Accept-Ranges:
72
- - bytes
73
- Age:
74
- - '0'
75
- Content-Type:
76
- - application/json
77
- Date:
78
- - Fri, 16 Oct 2015 16:40:14 GMT
79
- Server:
80
- - nginx/1.4.6 (Ubuntu)
81
- Strict-Transport-Security:
82
- - max-age=31536000
83
- Via:
84
- - 1.1 varnish
85
- X-Varnish:
86
- - '1717338996'
87
- Content-Length:
88
- - '126'
89
- Connection:
90
- - keep-alive
91
- body:
92
- encoding: UTF-8
93
- string: |-
94
- {
95
- "message": "You have supplied an invalid autocomplete key. Look up your valid autocomplete key in your admin dashboard."
96
- }
97
- http_version:
98
- recorded_at: Fri, 16 Oct 2015 16:40:11 GMT
99
- recorded_with: VCR 2.9.3