amee 4.3.2 → 4.4.0

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.
Files changed (63) hide show
  1. data/CHANGELOG.txt +6 -0
  2. data/Gemfile +7 -1
  3. data/Rakefile +2 -0
  4. data/VERSION +1 -1
  5. data/amee.gemspec +57 -6
  6. data/amee_test_credentials.example.yml +11 -0
  7. data/cassettes/AMEE_Connection/v2/raising_unhandled_errors.yml +36 -0
  8. data/cassettes/AMEE_Connection/v3/retries/502.yml +36 -0
  9. data/cassettes/AMEE_Connection/v3/retries/503.yml +36 -0
  10. data/cassettes/AMEE_Connection/v3/retries/504.yml +36 -0
  11. data/cassettes/AMEE_Connection/v3/retries/AMEE_TimeOut.yml +36 -0
  12. data/cassettes/AMEE_Connection/v3/should_be_able_to_get_from_meta_server.yml +30 -0
  13. data/cassettes/AMEE_Connection/v3/should_be_able_to_handle_failed_gets_from_meta_server.yml +30 -0
  14. data/cassettes/AMEE_Connection/v3/should_be_able_to_post_to_meta_server.yml +59 -0
  15. data/cassettes/AMEE_Connection/v3/should_have_a_connection_to_meta_server.yml +36 -0
  16. data/cassettes/AMEE_Connection/v3/should_login_and_know_the_path_to_the_server.yml +36 -0
  17. data/cassettes/AMEE_Connection_Caching_Off/authenticating.yml +36 -0
  18. data/cassettes/AMEE_Connection_Caching_Off/first_request.yml +40 -0
  19. data/cassettes/AMEE_Connection_Caching_Off/second_request.yml +40 -0
  20. data/cassettes/AMEE_Connection_Caching_On/authenticating.yml +36 -0
  21. data/cassettes/AMEE_Connection_Caching_On/first_request.yml +40 -0
  22. data/cassettes/AMEE_Connection_Caching_clear_all/second_request.yml +40 -0
  23. data/cassettes/AMEE_Connection_Caching_clear_manually/second_request.yml +40 -0
  24. data/cassettes/AMEE_Connection_Caching_further_down_tree/second_request.yml +79 -0
  25. data/cassettes/AMEE_Connection_with_authentication/handling_404s.yml +69 -0
  26. data/cassettes/AMEE_Connection_with_authentication/hitting_private_urls.yml +75 -0
  27. data/cassettes/AMEE_Connection_with_authentication/raising_errors_if_permission_denied.yml +69 -0
  28. data/cassettes/AMEE_Connection_with_authentication/should_re-authenticate_and_refresh_authtoken_when_authtoken_expires.yml +104 -0
  29. data/cassettes/AMEE_Connection_with_authentication/should_refresh_authtoken_when_authtoken_is_changed.yml +114 -0
  30. data/cassettes/AMEE_Connection_with_authentication/using_a_v1_key.yml +71 -0
  31. data/cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_JSON.yml +36 -0
  32. data/cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_XML.yml +36 -0
  33. data/cassettes/AMEE_Connection_with_authentication_doing_write-requests.yml +75 -0
  34. data/cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/deleting_existing_items.yml +108 -0
  35. data/cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/sending_updates_to_existing_items.yml +108 -0
  36. data/cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_private_url.yml +29 -0
  37. data/cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_public_url.yml +32 -0
  38. data/cassettes/AMEE_Connection_with_incorrect_server_name.yml +16 -0
  39. data/cassettes/AMEE_Connection_with_retry_enabled.yml +36 -0
  40. data/lib/amee/connection.rb +234 -110
  41. data/lib/amee/data_category.rb +2 -2
  42. data/lib/amee/data_item.rb +45 -2
  43. data/lib/amee/data_item_value.rb +1 -1
  44. data/lib/amee/exceptions.rb +5 -2
  45. data/lib/amee/parse_helper.rb +2 -0
  46. data/lib/amee/profile_item.rb +6 -2
  47. data/lib/amee/v3/connection.rb +77 -70
  48. data/lib/amee/v3/item_value_definition.rb +1 -1
  49. data/lib/amee/v3/return_value_definition.rb +1 -1
  50. data/spec/cache_spec.rb +107 -48
  51. data/spec/connection_spec.rb +224 -183
  52. data/spec/data_item_spec.rb +12 -0
  53. data/spec/data_item_value_history_spec.rb +4 -4
  54. data/spec/data_item_value_spec.rb +2 -2
  55. data/spec/fixtures/AD63A83B4D41.json +1 -1
  56. data/spec/fixtures/AD63A83B4D41.xml +1 -1
  57. data/spec/profile_item_spec.rb +14 -10
  58. data/spec/spec_helper.rb +29 -0
  59. data/spec/v3/connection_spec.rb +77 -65
  60. data/spec/v3/item_value_definition_spec.rb +1 -0
  61. data/spec/v3/return_value_definition_spec.rb +1 -1
  62. metadata +140 -24
  63. data/Gemfile.lock +0 -63
@@ -1,5 +1,11 @@
1
1
  = Changelog
2
2
 
3
+ == 4.4.0
4
+ * Support Data Item calculations without needing a Profile
5
+ * Change to use Typheous instead of Net::HTTP internally
6
+ * Support Nokogiri 1.5
7
+ * Made authentication more efficient
8
+
3
9
  == 4.3.2
4
10
  * Bugfix to cache key generation (introduced in 4.3.1)
5
11
 
data/Gemfile CHANGED
@@ -5,7 +5,9 @@ gem "appraisal"
5
5
  gem "activesupport", ">= 2.3.11"
6
6
  gem "json"
7
7
  gem "log4r"
8
- gem "nokogiri", "~> 1.4.4"
8
+ gem "nokogiri", "~> 1.4"
9
+ gem 'typhoeus'
10
+ gem 'log_buddy'
9
11
 
10
12
  # Appraisal doesn't like group blocks, so we add individually for now.
11
13
  gem "bundler", "~> 1.0.0", :group => :development
@@ -16,3 +18,7 @@ gem 'memcache-client', :group => :development
16
18
  gem 'rcov', :group => :development
17
19
  gem 'rdoc', :group => :development
18
20
  gem 'activerecord', ">= 2.3.11", :group => :development
21
+ gem 'vcr', :group => :development
22
+ gem 'webmock', :group => :development
23
+ gem 'pry', :group => :development
24
+ gem 'pry-doc', :group => :development
data/Rakefile CHANGED
@@ -20,6 +20,8 @@ task :default => [:spec]
20
20
  desc "Run specs"
21
21
  RSpec::Core::RakeTask.new do |t|
22
22
  # Put spec opts in a file named .rspec in root
23
+ t.rcov = true
24
+ t.rcov_opts = ['--exclude', 'spec,/*gems*,']
23
25
  end
24
26
 
25
27
  require 'jeweler'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.3.2
1
+ 4.4.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "amee"
8
- s.version = "4.3.2"
8
+ s.version = "4.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Smith", "James Hetherington", "Andrew Hill", "Andrew Berkeley"]
12
- s.date = "2012-01-09"
12
+ s.date = "2012-01-26"
13
13
  s.email = "james@floppy.org.uk"
14
14
  s.executables = ["ameesh"]
15
15
  s.extra_rdoc_files = [
@@ -21,15 +21,48 @@ Gem::Specification.new do |s|
21
21
  "Appraisals",
22
22
  "CHANGELOG.txt",
23
23
  "Gemfile",
24
- "Gemfile.lock",
25
24
  "LICENSE.txt",
26
25
  "README.txt",
27
26
  "Rakefile",
28
27
  "VERSION",
29
28
  "amee.example.yml",
30
29
  "amee.gemspec",
30
+ "amee_test_credentials.example.yml",
31
31
  "bin/ameesh",
32
32
  "cacert.pem",
33
+ "cassettes/AMEE_Connection/v2/raising_unhandled_errors.yml",
34
+ "cassettes/AMEE_Connection/v3/retries/502.yml",
35
+ "cassettes/AMEE_Connection/v3/retries/503.yml",
36
+ "cassettes/AMEE_Connection/v3/retries/504.yml",
37
+ "cassettes/AMEE_Connection/v3/retries/AMEE_TimeOut.yml",
38
+ "cassettes/AMEE_Connection/v3/should_be_able_to_get_from_meta_server.yml",
39
+ "cassettes/AMEE_Connection/v3/should_be_able_to_handle_failed_gets_from_meta_server.yml",
40
+ "cassettes/AMEE_Connection/v3/should_be_able_to_post_to_meta_server.yml",
41
+ "cassettes/AMEE_Connection/v3/should_have_a_connection_to_meta_server.yml",
42
+ "cassettes/AMEE_Connection/v3/should_login_and_know_the_path_to_the_server.yml",
43
+ "cassettes/AMEE_Connection_Caching_Off/authenticating.yml",
44
+ "cassettes/AMEE_Connection_Caching_Off/first_request.yml",
45
+ "cassettes/AMEE_Connection_Caching_Off/second_request.yml",
46
+ "cassettes/AMEE_Connection_Caching_On/authenticating.yml",
47
+ "cassettes/AMEE_Connection_Caching_On/first_request.yml",
48
+ "cassettes/AMEE_Connection_Caching_clear_all/second_request.yml",
49
+ "cassettes/AMEE_Connection_Caching_clear_manually/second_request.yml",
50
+ "cassettes/AMEE_Connection_Caching_further_down_tree/second_request.yml",
51
+ "cassettes/AMEE_Connection_with_authentication/handling_404s.yml",
52
+ "cassettes/AMEE_Connection_with_authentication/hitting_private_urls.yml",
53
+ "cassettes/AMEE_Connection_with_authentication/raising_errors_if_permission_denied.yml",
54
+ "cassettes/AMEE_Connection_with_authentication/should_re-authenticate_and_refresh_authtoken_when_authtoken_expires.yml",
55
+ "cassettes/AMEE_Connection_with_authentication/should_refresh_authtoken_when_authtoken_is_changed.yml",
56
+ "cassettes/AMEE_Connection_with_authentication/using_a_v1_key.yml",
57
+ "cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_JSON.yml",
58
+ "cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_XML.yml",
59
+ "cassettes/AMEE_Connection_with_authentication_doing_write-requests.yml",
60
+ "cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/deleting_existing_items.yml",
61
+ "cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/sending_updates_to_existing_items.yml",
62
+ "cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_private_url.yml",
63
+ "cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_public_url.yml",
64
+ "cassettes/AMEE_Connection_with_incorrect_server_name.yml",
65
+ "cassettes/AMEE_Connection_with_retry_enabled.yml",
33
66
  "examples/create_profile.rb",
34
67
  "examples/create_profile_item.rb",
35
68
  "examples/list_profiles.rb",
@@ -149,7 +182,9 @@ Gem::Specification.new do |s|
149
182
  s.add_runtime_dependency(%q<activesupport>, [">= 2.3.11"])
150
183
  s.add_runtime_dependency(%q<json>, [">= 0"])
151
184
  s.add_runtime_dependency(%q<log4r>, [">= 0"])
152
- s.add_runtime_dependency(%q<nokogiri>, ["~> 1.4.4"])
185
+ s.add_runtime_dependency(%q<nokogiri>, ["~> 1.4"])
186
+ s.add_runtime_dependency(%q<typhoeus>, [">= 0"])
187
+ s.add_runtime_dependency(%q<log_buddy>, [">= 0"])
153
188
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
154
189
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
155
190
  s.add_development_dependency(%q<rspec>, ["= 2.6.0"])
@@ -158,12 +193,18 @@ Gem::Specification.new do |s|
158
193
  s.add_development_dependency(%q<rcov>, [">= 0"])
159
194
  s.add_development_dependency(%q<rdoc>, [">= 0"])
160
195
  s.add_development_dependency(%q<activerecord>, [">= 2.3.11"])
196
+ s.add_development_dependency(%q<vcr>, [">= 0"])
197
+ s.add_development_dependency(%q<webmock>, [">= 0"])
198
+ s.add_development_dependency(%q<pry>, [">= 0"])
199
+ s.add_development_dependency(%q<pry-doc>, [">= 0"])
161
200
  else
162
201
  s.add_dependency(%q<appraisal>, [">= 0"])
163
202
  s.add_dependency(%q<activesupport>, [">= 2.3.11"])
164
203
  s.add_dependency(%q<json>, [">= 0"])
165
204
  s.add_dependency(%q<log4r>, [">= 0"])
166
- s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
205
+ s.add_dependency(%q<nokogiri>, ["~> 1.4"])
206
+ s.add_dependency(%q<typhoeus>, [">= 0"])
207
+ s.add_dependency(%q<log_buddy>, [">= 0"])
167
208
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
168
209
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
169
210
  s.add_dependency(%q<rspec>, ["= 2.6.0"])
@@ -172,13 +213,19 @@ Gem::Specification.new do |s|
172
213
  s.add_dependency(%q<rcov>, [">= 0"])
173
214
  s.add_dependency(%q<rdoc>, [">= 0"])
174
215
  s.add_dependency(%q<activerecord>, [">= 2.3.11"])
216
+ s.add_dependency(%q<vcr>, [">= 0"])
217
+ s.add_dependency(%q<webmock>, [">= 0"])
218
+ s.add_dependency(%q<pry>, [">= 0"])
219
+ s.add_dependency(%q<pry-doc>, [">= 0"])
175
220
  end
176
221
  else
177
222
  s.add_dependency(%q<appraisal>, [">= 0"])
178
223
  s.add_dependency(%q<activesupport>, [">= 2.3.11"])
179
224
  s.add_dependency(%q<json>, [">= 0"])
180
225
  s.add_dependency(%q<log4r>, [">= 0"])
181
- s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
226
+ s.add_dependency(%q<nokogiri>, ["~> 1.4"])
227
+ s.add_dependency(%q<typhoeus>, [">= 0"])
228
+ s.add_dependency(%q<log_buddy>, [">= 0"])
182
229
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
183
230
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
184
231
  s.add_dependency(%q<rspec>, ["= 2.6.0"])
@@ -187,6 +234,10 @@ Gem::Specification.new do |s|
187
234
  s.add_dependency(%q<rcov>, [">= 0"])
188
235
  s.add_dependency(%q<rdoc>, [">= 0"])
189
236
  s.add_dependency(%q<activerecord>, [">= 2.3.11"])
237
+ s.add_dependency(%q<vcr>, [">= 0"])
238
+ s.add_dependency(%q<webmock>, [">= 0"])
239
+ s.add_dependency(%q<pry>, [">= 0"])
240
+ s.add_dependency(%q<pry-doc>, [">= 0"])
190
241
  end
191
242
  end
192
243
 
@@ -0,0 +1,11 @@
1
+ # we use VCR to store the real responses and store them in source
2
+ # control, and test against those when developing
3
+ # you'll need to copy this file to run tests, in case you need to test
4
+ # against 'fresh' responses from the platform
5
+
6
+ v1:
7
+ api_key: amee_ruby_vcr_version_1
8
+ password: replace_me_with_a_real_password
9
+ v2:
10
+ api_key: amee_ruby_vcr_version_2
11
+ password: replace_me_with_a_real_password
@@ -0,0 +1,36 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: post
5
+ uri: https://stage.amee.com:443/auth/signIn
6
+ body: username=<AMEE_V2_API_KEY>&password=<AMEE_V2_PASSWORD>
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ expires:
16
+ - Mon, 28 Nov 2011 00:12:12 GMT
17
+ last-modified:
18
+ - Tue, 29 Nov 2011 00:12:12 GMT
19
+ content-type:
20
+ - application/xml; charset=UTF-8
21
+ via:
22
+ - 1.1 stage.amee.com
23
+ server:
24
+ - Noelios-Restlet-Engine/1.1.10
25
+ date:
26
+ - Tue, 29 Nov 2011 00:12:12 GMT
27
+ set-cookie:
28
+ - authToken=a1lHHStw/9dT1+GobZH2DRms7issOHyAVzdTlwMgia1kPX6ZTUWZrxW8Ef1pg+6oXLYs1dy0x8gRay+j9zgkd570z3fQkyhc16EMef6WqgU=; Path=/
29
+ authtoken:
30
+ - a1lHHStw/9dT1+GobZH2DRms7issOHyAVzdTlwMgia1kPX6ZTUWZrxW8Ef1pg+6oXLYs1dy0x8gRay+j9zgkd570z3fQkyhc16EMef6WqgU=
31
+ vary:
32
+ - Accept-Charset,Accept-Encoding,Accept-Language,Accept
33
+ transfer-encoding:
34
+ - chunked
35
+ body: <?xml version="1.0" encoding="UTF-8" standalone="no"?><Resources><SignInResource><Next>/auth</Next><User uid="58F26PHHLFEB"><Status>ACTIVE</Status><Type>STANDARD</Type><ApiVersion>2.0</ApiVersion><Locale>en_GB</Locale><TimeZone>UTC</TimeZone></User></SignInResource></Resources>
36
+ http_version: "1.1"
@@ -0,0 +1,36 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: post
5
+ uri: https://stage.amee.com:443/auth/signIn
6
+ body: username=<AMEE_V3_API_KEY>&password=<AMEE_V3_PASSWORD>
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ expires:
16
+ - Sun, 27 Nov 2011 23:36:16 GMT
17
+ last-modified:
18
+ - Mon, 28 Nov 2011 23:36:16 GMT
19
+ content-type:
20
+ - application/xml; charset=UTF-8
21
+ via:
22
+ - 1.1 stage.amee.com
23
+ server:
24
+ - Noelios-Restlet-Engine/1.1.10
25
+ date:
26
+ - Mon, 28 Nov 2011 23:36:16 GMT
27
+ set-cookie:
28
+ - authToken=M+LLX0EnN64FfuTa6XRytrRu+YX/EKLvhVUOKTSOUuyrX6mEELwcVs9oyvNWc+Wehe/BRC4cQzczRr4WB28rjcAHjw/DJ/LgGekocUXeBJA=; Path=/
29
+ authtoken:
30
+ - M+LLX0EnN64FfuTa6XRytrRu+YX/EKLvhVUOKTSOUuyrX6mEELwcVs9oyvNWc+Wehe/BRC4cQzczRr4WB28rjcAHjw/DJ/LgGekocUXeBJA=
31
+ vary:
32
+ - Accept-Charset,Accept-Encoding,Accept-Language,Accept
33
+ transfer-encoding:
34
+ - chunked
35
+ body: <?xml version="1.0" encoding="UTF-8" standalone="no"?><Resources><SignInResource><Next>/auth</Next><User uid="9D376C97D76F"><Status>ACTIVE</Status><Type>STANDARD</Type><ApiVersion>2.0</ApiVersion><Locale>en_GB</Locale><TimeZone>Europe/London</TimeZone></User></SignInResource></Resources>
36
+ http_version: "1.1"
@@ -0,0 +1,36 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: post
5
+ uri: https://stage.amee.com:443/auth/signIn
6
+ body: username=<AMEE_V3_API_KEY>&password=<AMEE_V3_PASSWORD>
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ expires:
16
+ - Sun, 27 Nov 2011 23:36:18 GMT
17
+ last-modified:
18
+ - Mon, 28 Nov 2011 23:36:18 GMT
19
+ content-type:
20
+ - application/xml; charset=UTF-8
21
+ via:
22
+ - 1.1 stage.amee.com
23
+ server:
24
+ - Noelios-Restlet-Engine/1.1.10
25
+ date:
26
+ - Mon, 28 Nov 2011 23:36:18 GMT
27
+ set-cookie:
28
+ - authToken=nSSisZS0GZWN0bmAGJAJI7jyYgiIPEcP5iY4/wqPbCAhg9lKHLZ5g4nSH/AKCBcnzujQavVIo8q4jGg6u1BkAA2aBQnVKzUMW1TLdhk3YZw=; Path=/
29
+ authtoken:
30
+ - nSSisZS0GZWN0bmAGJAJI7jyYgiIPEcP5iY4/wqPbCAhg9lKHLZ5g4nSH/AKCBcnzujQavVIo8q4jGg6u1BkAA2aBQnVKzUMW1TLdhk3YZw=
31
+ vary:
32
+ - Accept-Charset,Accept-Encoding,Accept-Language,Accept
33
+ transfer-encoding:
34
+ - chunked
35
+ body: <?xml version="1.0" encoding="UTF-8" standalone="no"?><Resources><SignInResource><Next>/auth</Next><User uid="9D376C97D76F"><Status>ACTIVE</Status><Type>STANDARD</Type><ApiVersion>2.0</ApiVersion><Locale>en_GB</Locale><TimeZone>Europe/London</TimeZone></User></SignInResource></Resources>
36
+ http_version: "1.1"
@@ -0,0 +1,36 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: post
5
+ uri: https://stage.amee.com:443/auth/signIn
6
+ body: username=<AMEE_V3_API_KEY>&password=<AMEE_V3_PASSWORD>
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ expires:
16
+ - Sun, 27 Nov 2011 23:36:20 GMT
17
+ last-modified:
18
+ - Mon, 28 Nov 2011 23:36:20 GMT
19
+ content-type:
20
+ - application/xml; charset=UTF-8
21
+ via:
22
+ - 1.1 stage.amee.com
23
+ server:
24
+ - Noelios-Restlet-Engine/1.1.10
25
+ date:
26
+ - Mon, 28 Nov 2011 23:36:20 GMT
27
+ set-cookie:
28
+ - authToken=Q+Ai7HxLVb86a5p1VbY4zMFJM5ML6Zc/iyu0gIHc1/HWeJQgVOPNTOTvAIrnN1WH3RKD0ktGN92ro+fDpltQKplp4bk2QjZIwpOvmx2GXbo=; Path=/
29
+ authtoken:
30
+ - Q+Ai7HxLVb86a5p1VbY4zMFJM5ML6Zc/iyu0gIHc1/HWeJQgVOPNTOTvAIrnN1WH3RKD0ktGN92ro+fDpltQKplp4bk2QjZIwpOvmx2GXbo=
31
+ vary:
32
+ - Accept-Charset,Accept-Encoding,Accept-Language,Accept
33
+ transfer-encoding:
34
+ - chunked
35
+ body: <?xml version="1.0" encoding="UTF-8" standalone="no"?><Resources><SignInResource><Next>/auth</Next><User uid="9D376C97D76F"><Status>ACTIVE</Status><Type>STANDARD</Type><ApiVersion>2.0</ApiVersion><Locale>en_GB</Locale><TimeZone>Europe/London</TimeZone></User></SignInResource></Resources>
36
+ http_version: "1.1"
@@ -0,0 +1,36 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: post
5
+ uri: https://stage.amee.com:443/auth/signIn
6
+ body: username=<AMEE_V3_API_KEY>&password=<AMEE_V3_PASSWORD>
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ expires:
16
+ - Sun, 27 Nov 2011 23:26:08 GMT
17
+ last-modified:
18
+ - Mon, 28 Nov 2011 23:26:08 GMT
19
+ content-type:
20
+ - application/xml; charset=UTF-8
21
+ via:
22
+ - 1.1 stage.amee.com
23
+ server:
24
+ - Noelios-Restlet-Engine/1.1.10
25
+ date:
26
+ - Mon, 28 Nov 2011 23:26:08 GMT
27
+ set-cookie:
28
+ - authToken=eQt9yP1z0yBQFKgmuaKuEm43ORUn2jBATQ4f0nWO7vgFYmOoLyecNWjdaTApF/3BeB4lz+SsunhpPK1nFXLp94O+Zl66PKjzcVZ0W3kKBpY=; Path=/
29
+ authtoken:
30
+ - eQt9yP1z0yBQFKgmuaKuEm43ORUn2jBATQ4f0nWO7vgFYmOoLyecNWjdaTApF/3BeB4lz+SsunhpPK1nFXLp94O+Zl66PKjzcVZ0W3kKBpY=
31
+ vary:
32
+ - Accept-Charset,Accept-Encoding,Accept-Language,Accept
33
+ transfer-encoding:
34
+ - chunked
35
+ body: <?xml version="1.0" encoding="UTF-8" standalone="no"?><Resources><SignInResource><Next>/auth</Next><User uid="9D376C97D76F"><Status>ACTIVE</Status><Type>STANDARD</Type><ApiVersion>2.0</ApiVersion><Locale>en_GB</Locale><TimeZone>Europe/London</TimeZone></User></SignInResource></Resources>
36
+ http_version: "1.1"
@@ -0,0 +1,30 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: get
5
+ uri: https://<AMEE_V2_API_KEY>:<AMEE_V2_PASSWORD>@platform-api-stage.amee.com:443/3/categories/Api_test
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ content-type:
16
+ - application/xml; charset=UTF-8
17
+ via:
18
+ - 1.1 platform-api-stage.amee.com
19
+ server:
20
+ - Noelios-Restlet-Engine/1.1.10
21
+ date:
22
+ - Thu, 12 Jan 2012 23:05:56 GMT
23
+ accept-ranges:
24
+ - bytes
25
+ vary:
26
+ - Accept-Charset,Accept-Encoding,Accept-Language,Accept
27
+ transfer-encoding:
28
+ - chunked
29
+ body: <?xml version="1.0" encoding="UTF-8" standalone="no"?><Representation><Category uid="039DCB9BA67D"><Name>api tests</Name><WikiName>Api_test</WikiName></Category><Status>OK</Status><Version>3.6.0</Version></Representation>
30
+ http_version: "1.1"
@@ -0,0 +1,30 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: get
5
+ uri: https://<AMEE_V2_API_KEY>:<AMEE_V2_PASSWORD>@platform-api-stage.amee.com:443/3/categories/SomeCategory
6
+ body:
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 404
13
+ message: Not Found
14
+ headers:
15
+ content-type:
16
+ - application/xml
17
+ via:
18
+ - 1.1 platform-api-stage.amee.com
19
+ server:
20
+ - Noelios-Restlet-Engine/1.1.10
21
+ date:
22
+ - Thu, 12 Jan 2012 22:58:15 GMT
23
+ accept-ranges:
24
+ - bytes
25
+ vary:
26
+ - Accept-Charset,Accept-Encoding,Accept-Language,Accept
27
+ transfer-encoding:
28
+ - chunked
29
+ body: <?xml version="1.0" encoding="UTF-8" standalone="no"?><Resources><Status><Code>404</Code><Name>Not Found</Name><Description>The server has not found anything matching the request URI</Description><URI>http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5</URI></Status></Resources>
30
+ http_version: "1.1"
@@ -0,0 +1,59 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: post
5
+ uri: https://platform-api-stage.amee.com:443/3/categories/039DCB9BA67D/items
6
+ body: values.question=1322523903
7
+ headers:
8
+ accept:
9
+ - application/xml
10
+ response: !ruby/struct:VCR::Response
11
+ status: !ruby/struct:VCR::ResponseStatus
12
+ code: 401
13
+ message: Unauthorized
14
+ headers:
15
+ via:
16
+ - 1.1 platform-api-stage.amee.com
17
+ content-type:
18
+ - application/xml
19
+ www-authenticate:
20
+ - Basic realm="AMEE Platform API"
21
+ date:
22
+ - Mon, 28 Nov 2011 23:45:04 GMT
23
+ server:
24
+ - Noelios-Restlet-Engine/1.1.10
25
+ accept-ranges:
26
+ - bytes
27
+ transfer-encoding:
28
+ - chunked
29
+ body: <?xml version="1.0" encoding="UTF-8" standalone="no"?><Resources><Status><Code>401</Code><Name>Unauthorized</Name><Description>The request requires user authentication</Description><URI>http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2</URI></Status></Resources>
30
+ http_version: "1.1"
31
+ - !ruby/struct:VCR::HTTPInteraction
32
+ request: !ruby/struct:VCR::Request
33
+ method: post
34
+ uri: https://<AMEE_V3_API_KEY>:<AMEE_V3_PASSWORD>@platform-api-stage.amee.com:443/3/categories/039DCB9BA67D/items
35
+ body: values.question=1322524956
36
+ headers:
37
+ accept:
38
+ - application/xml
39
+ response: !ruby/struct:VCR::Response
40
+ status: !ruby/struct:VCR::ResponseStatus
41
+ code: 201
42
+ message: Created
43
+ headers:
44
+ location:
45
+ - https://platform-api-stage.amee.com/3.6.0/categories/039DCB9BA67D/items/XZPAW1QW5NLK
46
+ content-type:
47
+ - text/plain
48
+ via:
49
+ - 1.1 platform-api-stage.amee.com
50
+ server:
51
+ - Noelios-Restlet-Engine/1.1.10
52
+ date:
53
+ - Tue, 29 Nov 2011 00:02:40 GMT
54
+ content-length:
55
+ - "0"
56
+ accept-ranges:
57
+ - bytes
58
+ body:
59
+ http_version: "1.1"