diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..671d1fe --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +1.9.3-p545 diff --git a/.rvmrc b/.rvmrc deleted file mode 100644 index 5baf9e1..0000000 --- a/.rvmrc +++ /dev/null @@ -1 +0,0 @@ -rvm 1.8.7@amee-ruby diff --git a/Gemfile b/Gemfile index 5c24880..7a6d254 100644 --- a/Gemfile +++ b/Gemfile @@ -10,18 +10,14 @@ gem 'typhoeus' gem 'log_buddy' # Appraisal doesn't like group blocks, so we add individually for now. -gem "bundler", "~> 1.1.0", :group => :development gem "jeweler", "~> 1.6.4", :group => :development -gem 'rspec', '2.6.0', :group => :development +gem 'rspec', '~> 2.14.0', :group => :development gem 'flexmock', '> 0.8.6', :group => :development gem 'memcache-client', :group => :development -gem 'rcov', :group => :development -gem 'rdoc', :group => :development gem 'activerecord', '>= 2.3.11', :group => :development -gem 'vcr', '~> 1', :group => :development -gem 'webmock', '>= 1.7.0', '< 1.8', :group => :development +gem 'vcr', :group => :development +gem 'webmock', :group => :development gem 'pry', :group => :development gem 'pry-doc', :group => :development - -gem 'rack', :group => :test \ No newline at end of file +gem 'rack', :group => :test diff --git a/README.txt b/README.txt index 41c9734..6e78753 100644 --- a/README.txt +++ b/README.txt @@ -90,23 +90,6 @@ database, an AMEE profile will be automatically created and destroyed with your model. By overriding the function amee_save in your model, you can store data in AMEE when your model is saved. -== CACHING - -The AMEE::Connection object implements an optional cache for GET requests. - -This uses ActiveSupport::Cache, and supports any ActiveSupport::Cache::Store -caching method except for MemCacheStore (which doesn't provide required features). - -All GET requests are cached. POST, PUT, or DELETEs will clear the cache for any -path that matches the affected URL. #expire, #expire_matching, and #expire_all -functions are available for manual cache management. Also, all AMEE objects have -and #expire-cache function to clear them and their descendants from the cache. - -To enable caching, pass ':cache => :memory_store' to AMEE::Connection.new, or add -'cache: memory_store' to your amee.yml if using Rails. If you want to use the -same caching configuration as your Rails app, you can add 'cache: rails' to -amee.yml instead. Caching is disabled by default. - == RETRY / TIMEOUT SUPPORT The AMEE::Connection object can now automatically retry if a request fails due to @@ -116,4 +99,4 @@ change the number of retry attempts, 3 is just used as an example above. The Connection object also allows a timeout to be set for requests. By default this is set to 60 seconds, but if you want to provide a different value (30 seconds for -instance), pass ':timeout => 30' to AMEE::Connection.new, or 'timeout: 30' in amee.yml. \ No newline at end of file +instance), pass ':timeout => 30' to AMEE::Connection.new, or 'timeout: 30' in amee.yml. diff --git a/Rakefile b/Rakefile index 92ad8de..4cee1a7 100644 --- a/Rakefile +++ b/Rakefile @@ -18,11 +18,7 @@ require 'rspec/core/rake_task' task :default => [:spec] desc "Run specs" -RSpec::Core::RakeTask.new do |t| - # Put spec opts in a file named .rspec in root - t.rcov = true - t.rcov_opts = ['--exclude', 'spec,/*gems*,'] -end +RSpec::Core::RakeTask.new require 'jeweler' # Fix for Jeweler to use stable branch @@ -72,13 +68,6 @@ Jeweler::Tasks.new do |gem| end Jeweler::RubygemsDotOrgTasks.new -require 'rcov/rcovtask' -desc "Generate code coverage" -RSpec::Core::RakeTask.new(:coverage) do |t| - t.rcov = true - t.rcov_opts = ['--exclude', 'spec,/*ruby*,/*gems*'] -end - require 'rdoc/task' RDoc::Task.new do |rd| rd.title = "AMEE Ruby" diff --git a/amee.gemspec b/amee.gemspec index 1d08a69..2a261e6 100644 --- a/amee.gemspec +++ b/amee.gemspec @@ -190,8 +190,6 @@ Gem::Specification.new do |s| s.add_development_dependency(%q, ["= 2.6.0"]) s.add_development_dependency(%q, ["> 0.8.6"]) s.add_development_dependency(%q, [">= 0"]) - s.add_development_dependency(%q, [">= 0"]) - s.add_development_dependency(%q, [">= 0"]) s.add_development_dependency(%q, [">= 2.3.11"]) s.add_development_dependency(%q, [">= 0"]) s.add_development_dependency(%q, [">= 0"]) @@ -210,8 +208,6 @@ Gem::Specification.new do |s| s.add_dependency(%q, ["= 2.6.0"]) s.add_dependency(%q, ["> 0.8.6"]) s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 2.3.11"]) s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) @@ -231,8 +227,6 @@ Gem::Specification.new do |s| s.add_dependency(%q, ["= 2.6.0"]) s.add_dependency(%q, ["> 0.8.6"]) s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) - s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 2.3.11"]) s.add_dependency(%q, [">= 0"]) s.add_dependency(%q, [">= 0"]) diff --git a/cassettes/.yml b/cassettes/.yml new file mode 100644 index 0000000..0b229f2 --- /dev/null +++ b/cassettes/.yml @@ -0,0 +1,24 @@ +--- +http_interactions: +- request: + method: post + uri: https://stage.amee.com/auth/signIn + body: + encoding: US-ASCII + string: username=&password= + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Accept: + - application/xml + response: + status: + code: 0 + message: + headers: {} + body: + encoding: US-ASCII + string: '' + http_version: + recorded_at: Fri, 03 Apr 2015 12:29:47 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection/v2/raising_unhandled_errors.yml b/cassettes/AMEE_Connection/v2/raising_unhandled_errors.yml index 660443e..9bd4c1c 100644 --- a/cassettes/AMEE_Connection/v2/raising_unhandled_errors.yml +++ b/cassettes/AMEE_Connection/v2/raising_unhandled_errors.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Mon, 28 Nov 2011 00:12:12 GMT - last-modified: + Last-Modified: - Tue, 29 Nov 2011 00:12:12 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Tue, 29 Nov 2011 00:12:12 GMT - set-cookie: - - authToken=a1lHHStw/9dT1+GobZH2DRms7issOHyAVzdTlwMgia1kPX6ZTUWZrxW8Ef1pg+6oXLYs1dy0x8gRay+j9zgkd570z3fQkyhc16EMef6WqgU=; Path=/ - authtoken: + Set-Cookie: + - authToken=a1lHHStw/9dT1+GobZH2DRms7issOHyAVzdTlwMgia1kPX6ZTUWZrxW8Ef1pg+6oXLYs1dy0x8gRay+j9zgkd570z3fQkyhc16EMef6WqgU=; + Path=/ + Authtoken: - a1lHHStw/9dT1+GobZH2DRms7issOHyAVzdTlwMgia1kPX6ZTUWZrxW8Ef1pg+6oXLYs1dy0x8gRay+j9zgkd570z3fQkyhc16EMef6WqgU= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection/v3/retries/502.yml b/cassettes/AMEE_Connection/v3/retries/502.yml index 20a82ec..b6b5700 100644 --- a/cassettes/AMEE_Connection/v3/retries/502.yml +++ b/cassettes/AMEE_Connection/v3/retries/502.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 23:36:16 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 23:36:16 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 23:36:16 GMT - set-cookie: - - authToken=M+LLX0EnN64FfuTa6XRytrRu+YX/EKLvhVUOKTSOUuyrX6mEELwcVs9oyvNWc+Wehe/BRC4cQzczRr4WB28rjcAHjw/DJ/LgGekocUXeBJA=; Path=/ - authtoken: + Set-Cookie: + - authToken=M+LLX0EnN64FfuTa6XRytrRu+YX/EKLvhVUOKTSOUuyrX6mEELwcVs9oyvNWc+Wehe/BRC4cQzczRr4WB28rjcAHjw/DJ/LgGekocUXeBJA=; + Path=/ + Authtoken: - M+LLX0EnN64FfuTa6XRytrRu+YX/EKLvhVUOKTSOUuyrX6mEELwcVs9oyvNWc+Wehe/BRC4cQzczRr4WB28rjcAHjw/DJ/LgGekocUXeBJA= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBEurope/London - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBEurope/London + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection/v3/retries/503.yml b/cassettes/AMEE_Connection/v3/retries/503.yml index 854febe..eee4e15 100644 --- a/cassettes/AMEE_Connection/v3/retries/503.yml +++ b/cassettes/AMEE_Connection/v3/retries/503.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 23:36:18 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 23:36:18 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 23:36:18 GMT - set-cookie: - - authToken=nSSisZS0GZWN0bmAGJAJI7jyYgiIPEcP5iY4/wqPbCAhg9lKHLZ5g4nSH/AKCBcnzujQavVIo8q4jGg6u1BkAA2aBQnVKzUMW1TLdhk3YZw=; Path=/ - authtoken: + Set-Cookie: + - authToken=nSSisZS0GZWN0bmAGJAJI7jyYgiIPEcP5iY4/wqPbCAhg9lKHLZ5g4nSH/AKCBcnzujQavVIo8q4jGg6u1BkAA2aBQnVKzUMW1TLdhk3YZw=; + Path=/ + Authtoken: - nSSisZS0GZWN0bmAGJAJI7jyYgiIPEcP5iY4/wqPbCAhg9lKHLZ5g4nSH/AKCBcnzujQavVIo8q4jGg6u1BkAA2aBQnVKzUMW1TLdhk3YZw= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBEurope/London - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBEurope/London + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection/v3/retries/504.yml b/cassettes/AMEE_Connection/v3/retries/504.yml index 4468433..c7582fa 100644 --- a/cassettes/AMEE_Connection/v3/retries/504.yml +++ b/cassettes/AMEE_Connection/v3/retries/504.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 23:36:20 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 23:36:20 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 23:36:20 GMT - set-cookie: - - authToken=Q+Ai7HxLVb86a5p1VbY4zMFJM5ML6Zc/iyu0gIHc1/HWeJQgVOPNTOTvAIrnN1WH3RKD0ktGN92ro+fDpltQKplp4bk2QjZIwpOvmx2GXbo=; Path=/ - authtoken: + Set-Cookie: + - authToken=Q+Ai7HxLVb86a5p1VbY4zMFJM5ML6Zc/iyu0gIHc1/HWeJQgVOPNTOTvAIrnN1WH3RKD0ktGN92ro+fDpltQKplp4bk2QjZIwpOvmx2GXbo=; + Path=/ + Authtoken: - Q+Ai7HxLVb86a5p1VbY4zMFJM5ML6Zc/iyu0gIHc1/HWeJQgVOPNTOTvAIrnN1WH3RKD0ktGN92ro+fDpltQKplp4bk2QjZIwpOvmx2GXbo= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBEurope/London - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBEurope/London + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection/v3/retries/AMEE_TimeOut.yml b/cassettes/AMEE_Connection/v3/retries/AMEE_TimeOut.yml index 3aeca0e..237c699 100644 --- a/cassettes/AMEE_Connection/v3/retries/AMEE_TimeOut.yml +++ b/cassettes/AMEE_Connection/v3/retries/AMEE_TimeOut.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 23:26:08 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 23:26:08 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 23:26:08 GMT - set-cookie: - - authToken=eQt9yP1z0yBQFKgmuaKuEm43ORUn2jBATQ4f0nWO7vgFYmOoLyecNWjdaTApF/3BeB4lz+SsunhpPK1nFXLp94O+Zl66PKjzcVZ0W3kKBpY=; Path=/ - authtoken: + Set-Cookie: + - authToken=eQt9yP1z0yBQFKgmuaKuEm43ORUn2jBATQ4f0nWO7vgFYmOoLyecNWjdaTApF/3BeB4lz+SsunhpPK1nFXLp94O+Zl66PKjzcVZ0W3kKBpY=; + Path=/ + Authtoken: - eQt9yP1z0yBQFKgmuaKuEm43ORUn2jBATQ4f0nWO7vgFYmOoLyecNWjdaTApF/3BeB4lz+SsunhpPK1nFXLp94O+Zl66PKjzcVZ0W3kKBpY= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBEurope/London - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBEurope/London + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection/v3/should_be_able_to_get_from_meta_server.yml b/cassettes/AMEE_Connection/v3/should_be_able_to_get_from_meta_server.yml index 257087c..f02127d 100644 --- a/cassettes/AMEE_Connection/v3/should_be_able_to_get_from_meta_server.yml +++ b/cassettes/AMEE_Connection/v3/should_be_able_to_get_from_meta_server.yml @@ -1,30 +1,37 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://:@platform-api-stage.amee.com:443/3/categories/Api_test - body: - headers: - accept: + uri: https://:@stage.amee.com/3/categories/Api_test + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - content-type: + headers: + Content-Type: - application/xml; charset=UTF-8 - via: - - 1.1 platform-api-stage.amee.com - server: + Via: + - 1.1 stage.amee.com + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Thu, 12 Jan 2012 23:05:56 GMT - accept-ranges: + Accept-Ranges: - bytes - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: api testsApi_testOK3.6.0 - http_version: "1.1" + body: + encoding: UTF-8 + string: api testsApi_testOK3.6.0 + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection/v3/should_be_able_to_handle_failed_gets_from_meta_server.yml b/cassettes/AMEE_Connection/v3/should_be_able_to_handle_failed_gets_from_meta_server.yml index 67fdf05..7240507 100644 --- a/cassettes/AMEE_Connection/v3/should_be_able_to_handle_failed_gets_from_meta_server.yml +++ b/cassettes/AMEE_Connection/v3/should_be_able_to_handle_failed_gets_from_meta_server.yml @@ -1,30 +1,38 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://:@platform-api-stage.amee.com:443/3/categories/SomeCategory - body: - headers: - accept: + uri: https://:@stage.amee.com/3/categories/SomeCategory + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 404 message: Not Found - headers: - content-type: + headers: + Content-Type: - application/xml - via: - - 1.1 platform-api-stage.amee.com - server: + Via: + - 1.1 stage.amee.com + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Thu, 12 Jan 2012 22:58:15 GMT - accept-ranges: + Accept-Ranges: - bytes - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: 404Not FoundThe server has not found anything matching the request URIhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5 - http_version: "1.1" + body: + encoding: UTF-8 + string: 404Not + FoundThe server has not found anything matching the request + URIhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5 + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection/v3/should_be_able_to_post_to_meta_server.yml b/cassettes/AMEE_Connection/v3/should_be_able_to_post_to_meta_server.yml index 477d5b6..632b8c8 100644 --- a/cassettes/AMEE_Connection/v3/should_be_able_to_post_to_meta_server.yml +++ b/cassettes/AMEE_Connection/v3/should_be_able_to_post_to_meta_server.yml @@ -1,59 +1,70 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://platform-api-stage.amee.com:443/3/categories/039DCB9BA67D/items - body: values.question=1322523903 - headers: - accept: + uri: https://stage.amee.com/3/categories/039DCB9BA67D/items + body: + encoding: UTF-8 + string: values.question=1322523903 + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 401 message: Unauthorized - headers: - via: - - 1.1 platform-api-stage.amee.com - content-type: + headers: + Via: + - 1.1 stage.amee.com + Content-Type: - application/xml - www-authenticate: + Www-Authenticate: - Basic realm="AMEE Platform API" - date: + Date: - Mon, 28 Nov 2011 23:45:04 GMT - server: + Server: - Noelios-Restlet-Engine/1.1.10 - accept-ranges: + Accept-Ranges: - bytes - transfer-encoding: + Transfer-Encoding: - chunked - body: 401UnauthorizedThe request requires user authenticationhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2 - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: 401UnauthorizedThe + request requires user authenticationhttp://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2 + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: post - uri: https://:@platform-api-stage.amee.com:443/3/categories/039DCB9BA67D/items - body: values.question=1322524956 - headers: - accept: + uri: https://:@stage.amee.com/3/categories/039DCB9BA67D/items + body: + encoding: UTF-8 + string: values.question=1322524956 + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 201 message: Created - headers: - location: - - https://platform-api-stage.amee.com/3.6.0/categories/039DCB9BA67D/items/XZPAW1QW5NLK - content-type: + headers: + Location: + - https://stage.amee.com/3.6.0/categories/039DCB9BA67D/items/XZPAW1QW5NLK + Content-Type: - text/plain - via: - - 1.1 platform-api-stage.amee.com - server: + Via: + - 1.1 stage.amee.com + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Tue, 29 Nov 2011 00:02:40 GMT - content-length: - - "0" - accept-ranges: + Content-Length: + - '0' + Accept-Ranges: - bytes - body: - http_version: "1.1" + body: + encoding: US-ASCII + string: '' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection/v3/should_have_a_connection_to_meta_server.yml b/cassettes/AMEE_Connection/v3/should_have_a_connection_to_meta_server.yml index 1928212..83b7157 100644 --- a/cassettes/AMEE_Connection/v3/should_have_a_connection_to_meta_server.yml +++ b/cassettes/AMEE_Connection/v3/should_have_a_connection_to_meta_server.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 22:59:27 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 22:59:27 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 22:59:27 GMT - set-cookie: - - authToken=QVrVlNyNpBjlDUx9Yb+G+5BMdLZv+mbTNrVzRjMnG/t/rUJ7/AqS+YJYxzOVXAsM+zvmdSTKAeey2qXrgJ+FiLrA+pl/DNY9U9E8KiODwTY=; Path=/ - authtoken: + Set-Cookie: + - authToken=QVrVlNyNpBjlDUx9Yb+G+5BMdLZv+mbTNrVzRjMnG/t/rUJ7/AqS+YJYxzOVXAsM+zvmdSTKAeey2qXrgJ+FiLrA+pl/DNY9U9E8KiODwTY=; + Path=/ + Authtoken: - QVrVlNyNpBjlDUx9Yb+G+5BMdLZv+mbTNrVzRjMnG/t/rUJ7/AqS+YJYxzOVXAsM+zvmdSTKAeey2qXrgJ+FiLrA+pl/DNY9U9E8KiODwTY= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBEurope/London - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBEurope/London + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection/v3/should_login_and_know_the_path_to_the_server.yml b/cassettes/AMEE_Connection/v3/should_login_and_know_the_path_to_the_server.yml index f267e66..a9c778f 100644 --- a/cassettes/AMEE_Connection/v3/should_login_and_know_the_path_to_the_server.yml +++ b/cassettes/AMEE_Connection/v3/should_login_and_know_the_path_to_the_server.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 22:59:27 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 22:59:27 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 22:59:27 GMT - set-cookie: - - authToken=4iVug0Nx3N+F/xHPBmUzFEoPYC/QHULCrlw9iM+O4Lywov1gSispAwyf8YkWyWfUVpagMW2Vq28YmLbyPDSJNVj1cY8BmMdhbPFbrpgEryI=; Path=/ - authtoken: + Set-Cookie: + - authToken=4iVug0Nx3N+F/xHPBmUzFEoPYC/QHULCrlw9iM+O4Lywov1gSispAwyf8YkWyWfUVpagMW2Vq28YmLbyPDSJNVj1cY8BmMdhbPFbrpgEryI=; + Path=/ + Authtoken: - 4iVug0Nx3N+F/xHPBmUzFEoPYC/QHULCrlw9iM+O4Lywov1gSispAwyf8YkWyWfUVpagMW2Vq28YmLbyPDSJNVj1cY8BmMdhbPFbrpgEryI= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBEurope/London - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBEurope/London + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_Caching_Off/authenticating.yml b/cassettes/AMEE_Connection_Caching_Off/authenticating.yml index 78b10f2..e6ebbd4 100644 --- a/cassettes/AMEE_Connection_Caching_Off/authenticating.yml +++ b/cassettes/AMEE_Connection_Caching_Off/authenticating.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 00:29:12 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 00:29:12 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 00:29:12 GMT - set-cookie: - - authToken=BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs=; Path=/ - authtoken: + Set-Cookie: + - authToken=BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs=; + Path=/ + Authtoken: - BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_Caching_Off/first_request.yml b/cassettes/AMEE_Connection_Caching_Off/first_request.yml index 5009c34..538b203 100644 --- a/cassettes/AMEE_Connection_Caching_Off/first_request.yml +++ b/cassettes/AMEE_Connection_Caching_Off/first_request.yml @@ -1,40 +1,71 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://stage.amee.com:443/data/home/energy/quantity?itemsPerPage=10 - body: - headers: - accept: + uri: https://stage.amee.com/data/home/energy/quantity?itemsPerPage=10 + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs= - authtoken: + Authtoken: - BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 00:29:12 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 00:29:12 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 00:29:12 GMT - content-length: - - "4349" - set-cookie: - - authToken=BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs=; Path=/ - authtoken: + Content-Length: + - '4349' + Set-Cookie: + - authToken=BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs=; + Path=/ + Authtoken: - BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"dataCategory\":{\"uid\":\"A92693A99BAD\",\"dataCategory\":{\"uid\":\"30BA55A0C472\",\"deprecated\":false,\"name\":\"Energy\",\"path\":\"energy\"},\"deprecated\":false,\"environment\":{\"uid\":\"5F5887BCF726\",\"itemsPerFeed\":10,\"description\":\"\",\"name\":\"AMEE\",\"owner\":\"\",\"path\":\"\",\"itemsPerPage\":10},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Quantity\",\"path\":\"quantity\",\"itemDefinition\":{\"uid\":\"212C818D8F16\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Energy Quantity\",\"drillDown\":\"type\",\"modified\":\"2011-02-16 08:00:50.0\"},\"modified\":\"2011-02-16 08:02:10.0\"},\"path\":\"/home/energy/quantity\",\"children\":{\"pager\":{\"to\":10,\"lastPage\":2,\"nextPage\":2,\"items\":12,\"start\":0,\"itemsFound\":10,\"requestedPage\":1,\"currentPage\":1,\"from\":1,\"itemsPerPage\":10,\"previousPage\":-1},\"dataItems\":{\"label\":\"DataItems\",\"rows\":[{\"uid\":\"878854C275BC\",\"startDate\":\"\",\"kgCO2PerKg\":\"\",\"kgCO2PerKWh\":\"\",\"source\":\"net CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"878854C275BC\",\"endDate\":\"\",\"label\":\"biodiesel\",\"kgCO2PerLitre\":\"2.5\",\"type\":\"biodiesel\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"CFA7F3896189\",\"startDate\":\"\",\"kgCO2PerKg\":\"0.1215\",\"kgCO2PerKWh\":\"0.0263\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"CFA7F3896189\",\"endDate\":\"\",\"label\":\"biomass\",\"kgCO2PerLitre\":\"\",\"type\":\"biomass\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"A70149AF0F26\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.5063\",\"kgCO2PerKWh\":\"0.3114\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"A70149AF0F26\",\"endDate\":\"\",\"label\":\"coal\",\"kgCO2PerLitre\":\"\",\"type\":\"coal\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"0093104E595C\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.81\",\"kgCO2PerKWh\":\"0.349\",\"source\":\"defra/amee 2008\",\"created\":\"2008-09-22 09:24:16.0\",\"path\":\"0093104E595C\",\"endDate\":\"\",\"label\":\"coking coal\",\"kgCO2PerLitre\":\"\",\"type\":\"coking coal\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"D6C9BC81155D\",\"startDate\":\"\",\"kgCO2PerKg\":\"3.1643\",\"kgCO2PerKWh\":\"0.2748\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"D6C9BC81155D\",\"endDate\":\"\",\"label\":\"diesel\",\"kgCO2PerLitre\":\"2.6391\",\"type\":\"diesel\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"CDC2A0BA8DF3\",\"startDate\":\"\",\"kgCO2PerKg\":\"\",\"kgCO2PerKWh\":\"\",\"source\":\"uses data in /home/energy/electricity\",\"created\":\"2008-10-22 06:24:32.0\",\"path\":\"CDC2A0BA8DF3\",\"endDate\":\"\",\"label\":\"electricity\",\"kgCO2PerLitre\":\"\",\"type\":\"electricity\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"66056991EE23\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.6935\",\"kgCO2PerKWh\":\"0.2037\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"66056991EE23\",\"endDate\":\"\",\"label\":\"gas\",\"kgCO2PerLitre\":\"0.0020091\",\"type\":\"gas\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"67D147AF530B\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.4269\",\"kgCO2PerKWh\":\"0.1836\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2009-07-09 14:53:18.0\",\"path\":\"67D147AF530B\",\"endDate\":\"\",\"label\":\"gas gross CV\",\"kgCO2PerLitre\":\"0.0018102\",\"type\":\"gas gross CV\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"C024BCE859BB\",\"startDate\":\"\",\"kgCO2PerKg\":\"3.1496\",\"kgCO2PerKWh\":\"0.2584\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"C024BCE859BB\",\"endDate\":\"\",\"label\":\"kerosene\",\"kgCO2PerLitre\":\"2.5278\",\"type\":\"kerosene\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"26709055568C\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.9424\",\"kgCO2PerKWh\":\"0.2255\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"26709055568C\",\"endDate\":\"\",\"label\":\"lpg\",\"kgCO2PerLitre\":\"1.4951\",\"type\":\"lpg\",\"modified\":\"2009-09-10 10:08:00.0\"}]},\"dataCategories\":[]}}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","dataCategory":{"uid":"A92693A99BAD","dataCategory":{"uid":"30BA55A0C472","deprecated":false,"name":"Energy","path":"energy"},"deprecated":false,"environment":{"uid":"5F5887BCF726","itemsPerFeed":10,"description":"","name":"AMEE","owner":"","path":"","itemsPerPage":10},"created":"2007-07-27 + 07:30:44.0","name":"Quantity","path":"quantity","itemDefinition":{"uid":"212C818D8F16","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","name":"Energy Quantity","drillDown":"type","modified":"2011-02-16 + 08:00:50.0"},"modified":"2011-02-16 08:02:10.0"},"path":"/home/energy/quantity","children":{"pager":{"to":10,"lastPage":2,"nextPage":2,"items":12,"start":0,"itemsFound":10,"requestedPage":1,"currentPage":1,"from":1,"itemsPerPage":10,"previousPage":-1},"dataItems":{"label":"DataItems","rows":[{"uid":"878854C275BC","startDate":"","kgCO2PerKg":"","kgCO2PerKWh":"","source":"net + CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html","created":"2007-07-27 + 09:49:32.0","path":"878854C275BC","endDate":"","label":"biodiesel","kgCO2PerLitre":"2.5","type":"biodiesel","modified":"2009-09-10 + 10:08:00.0"},{"uid":"CFA7F3896189","startDate":"","kgCO2PerKg":"0.1215","kgCO2PerKWh":"0.0263","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"CFA7F3896189","endDate":"","label":"biomass","kgCO2PerLitre":"","type":"biomass","modified":"2009-09-10 + 10:08:00.0"},{"uid":"A70149AF0F26","startDate":"","kgCO2PerKg":"2.5063","kgCO2PerKWh":"0.3114","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"A70149AF0F26","endDate":"","label":"coal","kgCO2PerLitre":"","type":"coal","modified":"2009-09-10 + 10:08:00.0"},{"uid":"0093104E595C","startDate":"","kgCO2PerKg":"2.81","kgCO2PerKWh":"0.349","source":"defra/amee + 2008","created":"2008-09-22 09:24:16.0","path":"0093104E595C","endDate":"","label":"coking + coal","kgCO2PerLitre":"","type":"coking coal","modified":"2009-09-10 10:08:00.0"},{"uid":"D6C9BC81155D","startDate":"","kgCO2PerKg":"3.1643","kgCO2PerKWh":"0.2748","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"D6C9BC81155D","endDate":"","label":"diesel","kgCO2PerLitre":"2.6391","type":"diesel","modified":"2009-09-10 + 10:08:00.0"},{"uid":"CDC2A0BA8DF3","startDate":"","kgCO2PerKg":"","kgCO2PerKWh":"","source":"uses + data in /home/energy/electricity","created":"2008-10-22 06:24:32.0","path":"CDC2A0BA8DF3","endDate":"","label":"electricity","kgCO2PerLitre":"","type":"electricity","modified":"2009-09-10 + 10:08:00.0"},{"uid":"66056991EE23","startDate":"","kgCO2PerKg":"2.6935","kgCO2PerKWh":"0.2037","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"66056991EE23","endDate":"","label":"gas","kgCO2PerLitre":"0.0020091","type":"gas","modified":"2009-09-10 + 10:08:00.0"},{"uid":"67D147AF530B","startDate":"","kgCO2PerKg":"2.4269","kgCO2PerKWh":"0.1836","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2009-07-09 + 14:53:18.0","path":"67D147AF530B","endDate":"","label":"gas gross CV","kgCO2PerLitre":"0.0018102","type":"gas + gross CV","modified":"2009-09-10 10:08:00.0"},{"uid":"C024BCE859BB","startDate":"","kgCO2PerKg":"3.1496","kgCO2PerKWh":"0.2584","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"C024BCE859BB","endDate":"","label":"kerosene","kgCO2PerLitre":"2.5278","type":"kerosene","modified":"2009-09-10 + 10:08:00.0"},{"uid":"26709055568C","startDate":"","kgCO2PerKg":"2.9424","kgCO2PerKWh":"0.2255","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"26709055568C","endDate":"","label":"lpg","kgCO2PerLitre":"1.4951","type":"lpg","modified":"2009-09-10 + 10:08:00.0"}]},"dataCategories":[]}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_Caching_Off/second_request.yml b/cassettes/AMEE_Connection_Caching_Off/second_request.yml index 5009c34..538b203 100644 --- a/cassettes/AMEE_Connection_Caching_Off/second_request.yml +++ b/cassettes/AMEE_Connection_Caching_Off/second_request.yml @@ -1,40 +1,71 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://stage.amee.com:443/data/home/energy/quantity?itemsPerPage=10 - body: - headers: - accept: + uri: https://stage.amee.com/data/home/energy/quantity?itemsPerPage=10 + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs= - authtoken: + Authtoken: - BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 00:29:12 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 00:29:12 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 00:29:12 GMT - content-length: - - "4349" - set-cookie: - - authToken=BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs=; Path=/ - authtoken: + Content-Length: + - '4349' + Set-Cookie: + - authToken=BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs=; + Path=/ + Authtoken: - BbWxnaWcPONGvJ6nL3YTw1qT1DCOSJVpAnJk3GbpBNLNYRdVhJw0lorzK1zoZTqKpODaWab9yyjkehCuKSgS5XUQP1YhVaaEM3P4/wB2Brs= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"dataCategory\":{\"uid\":\"A92693A99BAD\",\"dataCategory\":{\"uid\":\"30BA55A0C472\",\"deprecated\":false,\"name\":\"Energy\",\"path\":\"energy\"},\"deprecated\":false,\"environment\":{\"uid\":\"5F5887BCF726\",\"itemsPerFeed\":10,\"description\":\"\",\"name\":\"AMEE\",\"owner\":\"\",\"path\":\"\",\"itemsPerPage\":10},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Quantity\",\"path\":\"quantity\",\"itemDefinition\":{\"uid\":\"212C818D8F16\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Energy Quantity\",\"drillDown\":\"type\",\"modified\":\"2011-02-16 08:00:50.0\"},\"modified\":\"2011-02-16 08:02:10.0\"},\"path\":\"/home/energy/quantity\",\"children\":{\"pager\":{\"to\":10,\"lastPage\":2,\"nextPage\":2,\"items\":12,\"start\":0,\"itemsFound\":10,\"requestedPage\":1,\"currentPage\":1,\"from\":1,\"itemsPerPage\":10,\"previousPage\":-1},\"dataItems\":{\"label\":\"DataItems\",\"rows\":[{\"uid\":\"878854C275BC\",\"startDate\":\"\",\"kgCO2PerKg\":\"\",\"kgCO2PerKWh\":\"\",\"source\":\"net CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"878854C275BC\",\"endDate\":\"\",\"label\":\"biodiesel\",\"kgCO2PerLitre\":\"2.5\",\"type\":\"biodiesel\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"CFA7F3896189\",\"startDate\":\"\",\"kgCO2PerKg\":\"0.1215\",\"kgCO2PerKWh\":\"0.0263\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"CFA7F3896189\",\"endDate\":\"\",\"label\":\"biomass\",\"kgCO2PerLitre\":\"\",\"type\":\"biomass\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"A70149AF0F26\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.5063\",\"kgCO2PerKWh\":\"0.3114\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"A70149AF0F26\",\"endDate\":\"\",\"label\":\"coal\",\"kgCO2PerLitre\":\"\",\"type\":\"coal\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"0093104E595C\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.81\",\"kgCO2PerKWh\":\"0.349\",\"source\":\"defra/amee 2008\",\"created\":\"2008-09-22 09:24:16.0\",\"path\":\"0093104E595C\",\"endDate\":\"\",\"label\":\"coking coal\",\"kgCO2PerLitre\":\"\",\"type\":\"coking coal\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"D6C9BC81155D\",\"startDate\":\"\",\"kgCO2PerKg\":\"3.1643\",\"kgCO2PerKWh\":\"0.2748\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"D6C9BC81155D\",\"endDate\":\"\",\"label\":\"diesel\",\"kgCO2PerLitre\":\"2.6391\",\"type\":\"diesel\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"CDC2A0BA8DF3\",\"startDate\":\"\",\"kgCO2PerKg\":\"\",\"kgCO2PerKWh\":\"\",\"source\":\"uses data in /home/energy/electricity\",\"created\":\"2008-10-22 06:24:32.0\",\"path\":\"CDC2A0BA8DF3\",\"endDate\":\"\",\"label\":\"electricity\",\"kgCO2PerLitre\":\"\",\"type\":\"electricity\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"66056991EE23\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.6935\",\"kgCO2PerKWh\":\"0.2037\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"66056991EE23\",\"endDate\":\"\",\"label\":\"gas\",\"kgCO2PerLitre\":\"0.0020091\",\"type\":\"gas\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"67D147AF530B\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.4269\",\"kgCO2PerKWh\":\"0.1836\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2009-07-09 14:53:18.0\",\"path\":\"67D147AF530B\",\"endDate\":\"\",\"label\":\"gas gross CV\",\"kgCO2PerLitre\":\"0.0018102\",\"type\":\"gas gross CV\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"C024BCE859BB\",\"startDate\":\"\",\"kgCO2PerKg\":\"3.1496\",\"kgCO2PerKWh\":\"0.2584\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"C024BCE859BB\",\"endDate\":\"\",\"label\":\"kerosene\",\"kgCO2PerLitre\":\"2.5278\",\"type\":\"kerosene\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"26709055568C\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.9424\",\"kgCO2PerKWh\":\"0.2255\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"26709055568C\",\"endDate\":\"\",\"label\":\"lpg\",\"kgCO2PerLitre\":\"1.4951\",\"type\":\"lpg\",\"modified\":\"2009-09-10 10:08:00.0\"}]},\"dataCategories\":[]}}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","dataCategory":{"uid":"A92693A99BAD","dataCategory":{"uid":"30BA55A0C472","deprecated":false,"name":"Energy","path":"energy"},"deprecated":false,"environment":{"uid":"5F5887BCF726","itemsPerFeed":10,"description":"","name":"AMEE","owner":"","path":"","itemsPerPage":10},"created":"2007-07-27 + 07:30:44.0","name":"Quantity","path":"quantity","itemDefinition":{"uid":"212C818D8F16","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","name":"Energy Quantity","drillDown":"type","modified":"2011-02-16 + 08:00:50.0"},"modified":"2011-02-16 08:02:10.0"},"path":"/home/energy/quantity","children":{"pager":{"to":10,"lastPage":2,"nextPage":2,"items":12,"start":0,"itemsFound":10,"requestedPage":1,"currentPage":1,"from":1,"itemsPerPage":10,"previousPage":-1},"dataItems":{"label":"DataItems","rows":[{"uid":"878854C275BC","startDate":"","kgCO2PerKg":"","kgCO2PerKWh":"","source":"net + CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html","created":"2007-07-27 + 09:49:32.0","path":"878854C275BC","endDate":"","label":"biodiesel","kgCO2PerLitre":"2.5","type":"biodiesel","modified":"2009-09-10 + 10:08:00.0"},{"uid":"CFA7F3896189","startDate":"","kgCO2PerKg":"0.1215","kgCO2PerKWh":"0.0263","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"CFA7F3896189","endDate":"","label":"biomass","kgCO2PerLitre":"","type":"biomass","modified":"2009-09-10 + 10:08:00.0"},{"uid":"A70149AF0F26","startDate":"","kgCO2PerKg":"2.5063","kgCO2PerKWh":"0.3114","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"A70149AF0F26","endDate":"","label":"coal","kgCO2PerLitre":"","type":"coal","modified":"2009-09-10 + 10:08:00.0"},{"uid":"0093104E595C","startDate":"","kgCO2PerKg":"2.81","kgCO2PerKWh":"0.349","source":"defra/amee + 2008","created":"2008-09-22 09:24:16.0","path":"0093104E595C","endDate":"","label":"coking + coal","kgCO2PerLitre":"","type":"coking coal","modified":"2009-09-10 10:08:00.0"},{"uid":"D6C9BC81155D","startDate":"","kgCO2PerKg":"3.1643","kgCO2PerKWh":"0.2748","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"D6C9BC81155D","endDate":"","label":"diesel","kgCO2PerLitre":"2.6391","type":"diesel","modified":"2009-09-10 + 10:08:00.0"},{"uid":"CDC2A0BA8DF3","startDate":"","kgCO2PerKg":"","kgCO2PerKWh":"","source":"uses + data in /home/energy/electricity","created":"2008-10-22 06:24:32.0","path":"CDC2A0BA8DF3","endDate":"","label":"electricity","kgCO2PerLitre":"","type":"electricity","modified":"2009-09-10 + 10:08:00.0"},{"uid":"66056991EE23","startDate":"","kgCO2PerKg":"2.6935","kgCO2PerKWh":"0.2037","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"66056991EE23","endDate":"","label":"gas","kgCO2PerLitre":"0.0020091","type":"gas","modified":"2009-09-10 + 10:08:00.0"},{"uid":"67D147AF530B","startDate":"","kgCO2PerKg":"2.4269","kgCO2PerKWh":"0.1836","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2009-07-09 + 14:53:18.0","path":"67D147AF530B","endDate":"","label":"gas gross CV","kgCO2PerLitre":"0.0018102","type":"gas + gross CV","modified":"2009-09-10 10:08:00.0"},{"uid":"C024BCE859BB","startDate":"","kgCO2PerKg":"3.1496","kgCO2PerKWh":"0.2584","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"C024BCE859BB","endDate":"","label":"kerosene","kgCO2PerLitre":"2.5278","type":"kerosene","modified":"2009-09-10 + 10:08:00.0"},{"uid":"26709055568C","startDate":"","kgCO2PerKg":"2.9424","kgCO2PerKWh":"0.2255","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"26709055568C","endDate":"","label":"lpg","kgCO2PerLitre":"1.4951","type":"lpg","modified":"2009-09-10 + 10:08:00.0"}]},"dataCategories":[]}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_Caching_On/authenticating.yml b/cassettes/AMEE_Connection_Caching_On/authenticating.yml index cd03953..929523c 100644 --- a/cassettes/AMEE_Connection_Caching_On/authenticating.yml +++ b/cassettes/AMEE_Connection_Caching_On/authenticating.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 00:36:49 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 00:36:49 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 00:36:49 GMT - set-cookie: - - authToken=7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I=; Path=/ - authtoken: + Set-Cookie: + - authToken=7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I=; + Path=/ + Authtoken: - 7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_Caching_On/first_request.yml b/cassettes/AMEE_Connection_Caching_On/first_request.yml index 996fa48..5f44437 100644 --- a/cassettes/AMEE_Connection_Caching_On/first_request.yml +++ b/cassettes/AMEE_Connection_Caching_On/first_request.yml @@ -1,40 +1,71 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://stage.amee.com:443/data/home/energy/quantity?itemsPerPage=10 - body: - headers: - accept: + uri: https://stage.amee.com/data/home/energy/quantity?itemsPerPage=10 + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - authtoken: + Authtoken: - 7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 00:36:49 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 00:36:49 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 00:36:49 GMT - content-length: - - "4349" - set-cookie: - - authToken=7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I=; Path=/ - authtoken: + Content-Length: + - '4349' + Set-Cookie: + - authToken=7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I=; + Path=/ + Authtoken: - 7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"dataCategory\":{\"uid\":\"A92693A99BAD\",\"dataCategory\":{\"uid\":\"30BA55A0C472\",\"deprecated\":false,\"name\":\"Energy\",\"path\":\"energy\"},\"deprecated\":false,\"environment\":{\"uid\":\"5F5887BCF726\",\"itemsPerFeed\":10,\"description\":\"\",\"name\":\"AMEE\",\"owner\":\"\",\"path\":\"\",\"itemsPerPage\":10},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Quantity\",\"path\":\"quantity\",\"itemDefinition\":{\"uid\":\"212C818D8F16\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Energy Quantity\",\"drillDown\":\"type\",\"modified\":\"2011-02-16 08:00:50.0\"},\"modified\":\"2011-02-16 08:02:10.0\"},\"path\":\"/home/energy/quantity\",\"children\":{\"pager\":{\"to\":10,\"lastPage\":2,\"nextPage\":2,\"items\":12,\"start\":0,\"itemsFound\":10,\"requestedPage\":1,\"currentPage\":1,\"from\":1,\"itemsPerPage\":10,\"previousPage\":-1},\"dataItems\":{\"label\":\"DataItems\",\"rows\":[{\"uid\":\"878854C275BC\",\"startDate\":\"\",\"kgCO2PerKg\":\"\",\"kgCO2PerKWh\":\"\",\"source\":\"net CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"878854C275BC\",\"endDate\":\"\",\"label\":\"biodiesel\",\"kgCO2PerLitre\":\"2.5\",\"type\":\"biodiesel\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"CFA7F3896189\",\"startDate\":\"\",\"kgCO2PerKg\":\"0.1215\",\"kgCO2PerKWh\":\"0.0263\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"CFA7F3896189\",\"endDate\":\"\",\"label\":\"biomass\",\"kgCO2PerLitre\":\"\",\"type\":\"biomass\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"A70149AF0F26\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.5063\",\"kgCO2PerKWh\":\"0.3114\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"A70149AF0F26\",\"endDate\":\"\",\"label\":\"coal\",\"kgCO2PerLitre\":\"\",\"type\":\"coal\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"0093104E595C\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.81\",\"kgCO2PerKWh\":\"0.349\",\"source\":\"defra/amee 2008\",\"created\":\"2008-09-22 09:24:16.0\",\"path\":\"0093104E595C\",\"endDate\":\"\",\"label\":\"coking coal\",\"kgCO2PerLitre\":\"\",\"type\":\"coking coal\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"D6C9BC81155D\",\"startDate\":\"\",\"kgCO2PerKg\":\"3.1643\",\"kgCO2PerKWh\":\"0.2748\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"D6C9BC81155D\",\"endDate\":\"\",\"label\":\"diesel\",\"kgCO2PerLitre\":\"2.6391\",\"type\":\"diesel\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"CDC2A0BA8DF3\",\"startDate\":\"\",\"kgCO2PerKg\":\"\",\"kgCO2PerKWh\":\"\",\"source\":\"uses data in /home/energy/electricity\",\"created\":\"2008-10-22 06:24:32.0\",\"path\":\"CDC2A0BA8DF3\",\"endDate\":\"\",\"label\":\"electricity\",\"kgCO2PerLitre\":\"\",\"type\":\"electricity\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"66056991EE23\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.6935\",\"kgCO2PerKWh\":\"0.2037\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"66056991EE23\",\"endDate\":\"\",\"label\":\"gas\",\"kgCO2PerLitre\":\"0.0020091\",\"type\":\"gas\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"67D147AF530B\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.4269\",\"kgCO2PerKWh\":\"0.1836\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2009-07-09 14:53:18.0\",\"path\":\"67D147AF530B\",\"endDate\":\"\",\"label\":\"gas gross CV\",\"kgCO2PerLitre\":\"0.0018102\",\"type\":\"gas gross CV\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"C024BCE859BB\",\"startDate\":\"\",\"kgCO2PerKg\":\"3.1496\",\"kgCO2PerKWh\":\"0.2584\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"C024BCE859BB\",\"endDate\":\"\",\"label\":\"kerosene\",\"kgCO2PerLitre\":\"2.5278\",\"type\":\"kerosene\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"26709055568C\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.9424\",\"kgCO2PerKWh\":\"0.2255\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"26709055568C\",\"endDate\":\"\",\"label\":\"lpg\",\"kgCO2PerLitre\":\"1.4951\",\"type\":\"lpg\",\"modified\":\"2009-09-10 10:08:00.0\"}]},\"dataCategories\":[]}}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","dataCategory":{"uid":"A92693A99BAD","dataCategory":{"uid":"30BA55A0C472","deprecated":false,"name":"Energy","path":"energy"},"deprecated":false,"environment":{"uid":"5F5887BCF726","itemsPerFeed":10,"description":"","name":"AMEE","owner":"","path":"","itemsPerPage":10},"created":"2007-07-27 + 07:30:44.0","name":"Quantity","path":"quantity","itemDefinition":{"uid":"212C818D8F16","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","name":"Energy Quantity","drillDown":"type","modified":"2011-02-16 + 08:00:50.0"},"modified":"2011-02-16 08:02:10.0"},"path":"/home/energy/quantity","children":{"pager":{"to":10,"lastPage":2,"nextPage":2,"items":12,"start":0,"itemsFound":10,"requestedPage":1,"currentPage":1,"from":1,"itemsPerPage":10,"previousPage":-1},"dataItems":{"label":"DataItems","rows":[{"uid":"878854C275BC","startDate":"","kgCO2PerKg":"","kgCO2PerKWh":"","source":"net + CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html","created":"2007-07-27 + 09:49:32.0","path":"878854C275BC","endDate":"","label":"biodiesel","kgCO2PerLitre":"2.5","type":"biodiesel","modified":"2009-09-10 + 10:08:00.0"},{"uid":"CFA7F3896189","startDate":"","kgCO2PerKg":"0.1215","kgCO2PerKWh":"0.0263","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"CFA7F3896189","endDate":"","label":"biomass","kgCO2PerLitre":"","type":"biomass","modified":"2009-09-10 + 10:08:00.0"},{"uid":"A70149AF0F26","startDate":"","kgCO2PerKg":"2.5063","kgCO2PerKWh":"0.3114","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"A70149AF0F26","endDate":"","label":"coal","kgCO2PerLitre":"","type":"coal","modified":"2009-09-10 + 10:08:00.0"},{"uid":"0093104E595C","startDate":"","kgCO2PerKg":"2.81","kgCO2PerKWh":"0.349","source":"defra/amee + 2008","created":"2008-09-22 09:24:16.0","path":"0093104E595C","endDate":"","label":"coking + coal","kgCO2PerLitre":"","type":"coking coal","modified":"2009-09-10 10:08:00.0"},{"uid":"D6C9BC81155D","startDate":"","kgCO2PerKg":"3.1643","kgCO2PerKWh":"0.2748","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"D6C9BC81155D","endDate":"","label":"diesel","kgCO2PerLitre":"2.6391","type":"diesel","modified":"2009-09-10 + 10:08:00.0"},{"uid":"CDC2A0BA8DF3","startDate":"","kgCO2PerKg":"","kgCO2PerKWh":"","source":"uses + data in /home/energy/electricity","created":"2008-10-22 06:24:32.0","path":"CDC2A0BA8DF3","endDate":"","label":"electricity","kgCO2PerLitre":"","type":"electricity","modified":"2009-09-10 + 10:08:00.0"},{"uid":"66056991EE23","startDate":"","kgCO2PerKg":"2.6935","kgCO2PerKWh":"0.2037","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"66056991EE23","endDate":"","label":"gas","kgCO2PerLitre":"0.0020091","type":"gas","modified":"2009-09-10 + 10:08:00.0"},{"uid":"67D147AF530B","startDate":"","kgCO2PerKg":"2.4269","kgCO2PerKWh":"0.1836","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2009-07-09 + 14:53:18.0","path":"67D147AF530B","endDate":"","label":"gas gross CV","kgCO2PerLitre":"0.0018102","type":"gas + gross CV","modified":"2009-09-10 10:08:00.0"},{"uid":"C024BCE859BB","startDate":"","kgCO2PerKg":"3.1496","kgCO2PerKWh":"0.2584","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"C024BCE859BB","endDate":"","label":"kerosene","kgCO2PerLitre":"2.5278","type":"kerosene","modified":"2009-09-10 + 10:08:00.0"},{"uid":"26709055568C","startDate":"","kgCO2PerKg":"2.9424","kgCO2PerKWh":"0.2255","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"26709055568C","endDate":"","label":"lpg","kgCO2PerLitre":"1.4951","type":"lpg","modified":"2009-09-10 + 10:08:00.0"}]},"dataCategories":[]}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_Caching_clear_all/second_request.yml b/cassettes/AMEE_Connection_Caching_clear_all/second_request.yml index 99af196..586d042 100644 --- a/cassettes/AMEE_Connection_Caching_clear_all/second_request.yml +++ b/cassettes/AMEE_Connection_Caching_clear_all/second_request.yml @@ -1,40 +1,71 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://stage.amee.com:443/data/home/energy/quantity?itemsPerPage=10 - body: - headers: - accept: + uri: https://stage.amee.com/data/home/energy/quantity?itemsPerPage=10 + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - authtoken: + Authtoken: - 7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 00:42:04 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 00:42:04 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 00:42:04 GMT - content-length: - - "4349" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i57EL1VlAnxL3/qFaS3kX+BM0tbuvWQBBqWipKXzMeKHi5+tZBGUzwv4TJkPWfT+Go=; Path=/ - authtoken: + Content-Length: + - '4349' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i57EL1VlAnxL3/qFaS3kX+BM0tbuvWQBBqWipKXzMeKHi5+tZBGUzwv4TJkPWfT+Go=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i57EL1VlAnxL3/qFaS3kX+BM0tbuvWQBBqWipKXzMeKHi5+tZBGUzwv4TJkPWfT+Go= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"dataCategory\":{\"uid\":\"A92693A99BAD\",\"dataCategory\":{\"uid\":\"30BA55A0C472\",\"deprecated\":false,\"name\":\"Energy\",\"path\":\"energy\"},\"deprecated\":false,\"environment\":{\"uid\":\"5F5887BCF726\",\"itemsPerFeed\":10,\"description\":\"\",\"name\":\"AMEE\",\"owner\":\"\",\"path\":\"\",\"itemsPerPage\":10},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Quantity\",\"path\":\"quantity\",\"itemDefinition\":{\"uid\":\"212C818D8F16\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Energy Quantity\",\"drillDown\":\"type\",\"modified\":\"2011-02-16 08:00:50.0\"},\"modified\":\"2011-02-16 08:02:10.0\"},\"path\":\"/home/energy/quantity\",\"children\":{\"pager\":{\"to\":10,\"lastPage\":2,\"nextPage\":2,\"items\":12,\"start\":0,\"itemsFound\":10,\"requestedPage\":1,\"currentPage\":1,\"from\":1,\"itemsPerPage\":10,\"previousPage\":-1},\"dataItems\":{\"label\":\"DataItems\",\"rows\":[{\"uid\":\"878854C275BC\",\"startDate\":\"\",\"kgCO2PerKg\":\"\",\"kgCO2PerKWh\":\"\",\"source\":\"net CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"878854C275BC\",\"endDate\":\"\",\"label\":\"biodiesel\",\"kgCO2PerLitre\":\"2.5\",\"type\":\"biodiesel\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"CFA7F3896189\",\"startDate\":\"\",\"kgCO2PerKg\":\"0.1215\",\"kgCO2PerKWh\":\"0.0263\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"CFA7F3896189\",\"endDate\":\"\",\"label\":\"biomass\",\"kgCO2PerLitre\":\"\",\"type\":\"biomass\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"A70149AF0F26\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.5063\",\"kgCO2PerKWh\":\"0.3114\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"A70149AF0F26\",\"endDate\":\"\",\"label\":\"coal\",\"kgCO2PerLitre\":\"\",\"type\":\"coal\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"0093104E595C\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.81\",\"kgCO2PerKWh\":\"0.349\",\"source\":\"defra/amee 2008\",\"created\":\"2008-09-22 09:24:16.0\",\"path\":\"0093104E595C\",\"endDate\":\"\",\"label\":\"coking coal\",\"kgCO2PerLitre\":\"\",\"type\":\"coking coal\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"D6C9BC81155D\",\"startDate\":\"\",\"kgCO2PerKg\":\"3.1643\",\"kgCO2PerKWh\":\"0.2748\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"D6C9BC81155D\",\"endDate\":\"\",\"label\":\"diesel\",\"kgCO2PerLitre\":\"2.6391\",\"type\":\"diesel\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"CDC2A0BA8DF3\",\"startDate\":\"\",\"kgCO2PerKg\":\"\",\"kgCO2PerKWh\":\"\",\"source\":\"uses data in /home/energy/electricity\",\"created\":\"2008-10-22 06:24:32.0\",\"path\":\"CDC2A0BA8DF3\",\"endDate\":\"\",\"label\":\"electricity\",\"kgCO2PerLitre\":\"\",\"type\":\"electricity\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"66056991EE23\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.6935\",\"kgCO2PerKWh\":\"0.2037\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"66056991EE23\",\"endDate\":\"\",\"label\":\"gas\",\"kgCO2PerLitre\":\"0.0020091\",\"type\":\"gas\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"67D147AF530B\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.4269\",\"kgCO2PerKWh\":\"0.1836\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2009-07-09 14:53:18.0\",\"path\":\"67D147AF530B\",\"endDate\":\"\",\"label\":\"gas gross CV\",\"kgCO2PerLitre\":\"0.0018102\",\"type\":\"gas gross CV\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"C024BCE859BB\",\"startDate\":\"\",\"kgCO2PerKg\":\"3.1496\",\"kgCO2PerKWh\":\"0.2584\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"C024BCE859BB\",\"endDate\":\"\",\"label\":\"kerosene\",\"kgCO2PerLitre\":\"2.5278\",\"type\":\"kerosene\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"26709055568C\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.9424\",\"kgCO2PerKWh\":\"0.2255\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"26709055568C\",\"endDate\":\"\",\"label\":\"lpg\",\"kgCO2PerLitre\":\"1.4951\",\"type\":\"lpg\",\"modified\":\"2009-09-10 10:08:00.0\"}]},\"dataCategories\":[]}}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","dataCategory":{"uid":"A92693A99BAD","dataCategory":{"uid":"30BA55A0C472","deprecated":false,"name":"Energy","path":"energy"},"deprecated":false,"environment":{"uid":"5F5887BCF726","itemsPerFeed":10,"description":"","name":"AMEE","owner":"","path":"","itemsPerPage":10},"created":"2007-07-27 + 07:30:44.0","name":"Quantity","path":"quantity","itemDefinition":{"uid":"212C818D8F16","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","name":"Energy Quantity","drillDown":"type","modified":"2011-02-16 + 08:00:50.0"},"modified":"2011-02-16 08:02:10.0"},"path":"/home/energy/quantity","children":{"pager":{"to":10,"lastPage":2,"nextPage":2,"items":12,"start":0,"itemsFound":10,"requestedPage":1,"currentPage":1,"from":1,"itemsPerPage":10,"previousPage":-1},"dataItems":{"label":"DataItems","rows":[{"uid":"878854C275BC","startDate":"","kgCO2PerKg":"","kgCO2PerKWh":"","source":"net + CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html","created":"2007-07-27 + 09:49:32.0","path":"878854C275BC","endDate":"","label":"biodiesel","kgCO2PerLitre":"2.5","type":"biodiesel","modified":"2009-09-10 + 10:08:00.0"},{"uid":"CFA7F3896189","startDate":"","kgCO2PerKg":"0.1215","kgCO2PerKWh":"0.0263","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"CFA7F3896189","endDate":"","label":"biomass","kgCO2PerLitre":"","type":"biomass","modified":"2009-09-10 + 10:08:00.0"},{"uid":"A70149AF0F26","startDate":"","kgCO2PerKg":"2.5063","kgCO2PerKWh":"0.3114","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"A70149AF0F26","endDate":"","label":"coal","kgCO2PerLitre":"","type":"coal","modified":"2009-09-10 + 10:08:00.0"},{"uid":"0093104E595C","startDate":"","kgCO2PerKg":"2.81","kgCO2PerKWh":"0.349","source":"defra/amee + 2008","created":"2008-09-22 09:24:16.0","path":"0093104E595C","endDate":"","label":"coking + coal","kgCO2PerLitre":"","type":"coking coal","modified":"2009-09-10 10:08:00.0"},{"uid":"D6C9BC81155D","startDate":"","kgCO2PerKg":"3.1643","kgCO2PerKWh":"0.2748","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"D6C9BC81155D","endDate":"","label":"diesel","kgCO2PerLitre":"2.6391","type":"diesel","modified":"2009-09-10 + 10:08:00.0"},{"uid":"CDC2A0BA8DF3","startDate":"","kgCO2PerKg":"","kgCO2PerKWh":"","source":"uses + data in /home/energy/electricity","created":"2008-10-22 06:24:32.0","path":"CDC2A0BA8DF3","endDate":"","label":"electricity","kgCO2PerLitre":"","type":"electricity","modified":"2009-09-10 + 10:08:00.0"},{"uid":"66056991EE23","startDate":"","kgCO2PerKg":"2.6935","kgCO2PerKWh":"0.2037","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"66056991EE23","endDate":"","label":"gas","kgCO2PerLitre":"0.0020091","type":"gas","modified":"2009-09-10 + 10:08:00.0"},{"uid":"67D147AF530B","startDate":"","kgCO2PerKg":"2.4269","kgCO2PerKWh":"0.1836","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2009-07-09 + 14:53:18.0","path":"67D147AF530B","endDate":"","label":"gas gross CV","kgCO2PerLitre":"0.0018102","type":"gas + gross CV","modified":"2009-09-10 10:08:00.0"},{"uid":"C024BCE859BB","startDate":"","kgCO2PerKg":"3.1496","kgCO2PerKWh":"0.2584","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"C024BCE859BB","endDate":"","label":"kerosene","kgCO2PerLitre":"2.5278","type":"kerosene","modified":"2009-09-10 + 10:08:00.0"},{"uid":"26709055568C","startDate":"","kgCO2PerKg":"2.9424","kgCO2PerKWh":"0.2255","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"26709055568C","endDate":"","label":"lpg","kgCO2PerLitre":"1.4951","type":"lpg","modified":"2009-09-10 + 10:08:00.0"}]},"dataCategories":[]}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_Caching_clear_manually/second_request.yml b/cassettes/AMEE_Connection_Caching_clear_manually/second_request.yml index 8b2e349..3af1adc 100644 --- a/cassettes/AMEE_Connection_Caching_clear_manually/second_request.yml +++ b/cassettes/AMEE_Connection_Caching_clear_manually/second_request.yml @@ -1,40 +1,71 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://stage.amee.com:443/data/home/energy/quantity?itemsPerPage=10 - body: - headers: - accept: + uri: https://stage.amee.com/data/home/energy/quantity?itemsPerPage=10 + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - authtoken: + Authtoken: - 7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 00:46:43 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 00:46:43 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 00:46:43 GMT - content-length: - - "4349" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i7wwh3RRZM0P0nD3xeI5QrBlFhtGrqtDmSis1dGlBADtS2+JX8R7FO2nyu1M/DjFyM=; Path=/ - authtoken: + Content-Length: + - '4349' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i7wwh3RRZM0P0nD3xeI5QrBlFhtGrqtDmSis1dGlBADtS2+JX8R7FO2nyu1M/DjFyM=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i7wwh3RRZM0P0nD3xeI5QrBlFhtGrqtDmSis1dGlBADtS2+JX8R7FO2nyu1M/DjFyM= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"dataCategory\":{\"uid\":\"A92693A99BAD\",\"dataCategory\":{\"uid\":\"30BA55A0C472\",\"deprecated\":false,\"name\":\"Energy\",\"path\":\"energy\"},\"deprecated\":false,\"environment\":{\"uid\":\"5F5887BCF726\",\"itemsPerFeed\":10,\"description\":\"\",\"name\":\"AMEE\",\"owner\":\"\",\"path\":\"\",\"itemsPerPage\":10},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Quantity\",\"path\":\"quantity\",\"itemDefinition\":{\"uid\":\"212C818D8F16\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Energy Quantity\",\"drillDown\":\"type\",\"modified\":\"2011-02-16 08:00:50.0\"},\"modified\":\"2011-02-16 08:02:10.0\"},\"path\":\"/home/energy/quantity\",\"children\":{\"pager\":{\"to\":10,\"lastPage\":2,\"nextPage\":2,\"items\":12,\"start\":0,\"itemsFound\":10,\"requestedPage\":1,\"currentPage\":1,\"from\":1,\"itemsPerPage\":10,\"previousPage\":-1},\"dataItems\":{\"label\":\"DataItems\",\"rows\":[{\"uid\":\"878854C275BC\",\"startDate\":\"\",\"kgCO2PerKg\":\"\",\"kgCO2PerKWh\":\"\",\"source\":\"net CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"878854C275BC\",\"endDate\":\"\",\"label\":\"biodiesel\",\"kgCO2PerLitre\":\"2.5\",\"type\":\"biodiesel\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"CFA7F3896189\",\"startDate\":\"\",\"kgCO2PerKg\":\"0.1215\",\"kgCO2PerKWh\":\"0.0263\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"CFA7F3896189\",\"endDate\":\"\",\"label\":\"biomass\",\"kgCO2PerLitre\":\"\",\"type\":\"biomass\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"A70149AF0F26\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.5063\",\"kgCO2PerKWh\":\"0.3114\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"A70149AF0F26\",\"endDate\":\"\",\"label\":\"coal\",\"kgCO2PerLitre\":\"\",\"type\":\"coal\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"0093104E595C\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.81\",\"kgCO2PerKWh\":\"0.349\",\"source\":\"defra/amee 2008\",\"created\":\"2008-09-22 09:24:16.0\",\"path\":\"0093104E595C\",\"endDate\":\"\",\"label\":\"coking coal\",\"kgCO2PerLitre\":\"\",\"type\":\"coking coal\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"D6C9BC81155D\",\"startDate\":\"\",\"kgCO2PerKg\":\"3.1643\",\"kgCO2PerKWh\":\"0.2748\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"D6C9BC81155D\",\"endDate\":\"\",\"label\":\"diesel\",\"kgCO2PerLitre\":\"2.6391\",\"type\":\"diesel\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"CDC2A0BA8DF3\",\"startDate\":\"\",\"kgCO2PerKg\":\"\",\"kgCO2PerKWh\":\"\",\"source\":\"uses data in /home/energy/electricity\",\"created\":\"2008-10-22 06:24:32.0\",\"path\":\"CDC2A0BA8DF3\",\"endDate\":\"\",\"label\":\"electricity\",\"kgCO2PerLitre\":\"\",\"type\":\"electricity\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"66056991EE23\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.6935\",\"kgCO2PerKWh\":\"0.2037\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"66056991EE23\",\"endDate\":\"\",\"label\":\"gas\",\"kgCO2PerLitre\":\"0.0020091\",\"type\":\"gas\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"67D147AF530B\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.4269\",\"kgCO2PerKWh\":\"0.1836\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2009-07-09 14:53:18.0\",\"path\":\"67D147AF530B\",\"endDate\":\"\",\"label\":\"gas gross CV\",\"kgCO2PerLitre\":\"0.0018102\",\"type\":\"gas gross CV\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"C024BCE859BB\",\"startDate\":\"\",\"kgCO2PerKg\":\"3.1496\",\"kgCO2PerKWh\":\"0.2584\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"C024BCE859BB\",\"endDate\":\"\",\"label\":\"kerosene\",\"kgCO2PerLitre\":\"2.5278\",\"type\":\"kerosene\",\"modified\":\"2009-09-10 10:08:00.0\"},{\"uid\":\"26709055568C\",\"startDate\":\"\",\"kgCO2PerKg\":\"2.9424\",\"kgCO2PerKWh\":\"0.2255\",\"source\":\"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls\",\"created\":\"2007-07-27 09:49:32.0\",\"path\":\"26709055568C\",\"endDate\":\"\",\"label\":\"lpg\",\"kgCO2PerLitre\":\"1.4951\",\"type\":\"lpg\",\"modified\":\"2009-09-10 10:08:00.0\"}]},\"dataCategories\":[]}}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","dataCategory":{"uid":"A92693A99BAD","dataCategory":{"uid":"30BA55A0C472","deprecated":false,"name":"Energy","path":"energy"},"deprecated":false,"environment":{"uid":"5F5887BCF726","itemsPerFeed":10,"description":"","name":"AMEE","owner":"","path":"","itemsPerPage":10},"created":"2007-07-27 + 07:30:44.0","name":"Quantity","path":"quantity","itemDefinition":{"uid":"212C818D8F16","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","name":"Energy Quantity","drillDown":"type","modified":"2011-02-16 + 08:00:50.0"},"modified":"2011-02-16 08:02:10.0"},"path":"/home/energy/quantity","children":{"pager":{"to":10,"lastPage":2,"nextPage":2,"items":12,"start":0,"itemsFound":10,"requestedPage":1,"currentPage":1,"from":1,"itemsPerPage":10,"previousPage":-1},"dataItems":{"label":"DataItems","rows":[{"uid":"878854C275BC","startDate":"","kgCO2PerKg":"","kgCO2PerKWh":"","source":"net + CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html","created":"2007-07-27 + 09:49:32.0","path":"878854C275BC","endDate":"","label":"biodiesel","kgCO2PerLitre":"2.5","type":"biodiesel","modified":"2009-09-10 + 10:08:00.0"},{"uid":"CFA7F3896189","startDate":"","kgCO2PerKg":"0.1215","kgCO2PerKWh":"0.0263","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"CFA7F3896189","endDate":"","label":"biomass","kgCO2PerLitre":"","type":"biomass","modified":"2009-09-10 + 10:08:00.0"},{"uid":"A70149AF0F26","startDate":"","kgCO2PerKg":"2.5063","kgCO2PerKWh":"0.3114","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"A70149AF0F26","endDate":"","label":"coal","kgCO2PerLitre":"","type":"coal","modified":"2009-09-10 + 10:08:00.0"},{"uid":"0093104E595C","startDate":"","kgCO2PerKg":"2.81","kgCO2PerKWh":"0.349","source":"defra/amee + 2008","created":"2008-09-22 09:24:16.0","path":"0093104E595C","endDate":"","label":"coking + coal","kgCO2PerLitre":"","type":"coking coal","modified":"2009-09-10 10:08:00.0"},{"uid":"D6C9BC81155D","startDate":"","kgCO2PerKg":"3.1643","kgCO2PerKWh":"0.2748","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"D6C9BC81155D","endDate":"","label":"diesel","kgCO2PerLitre":"2.6391","type":"diesel","modified":"2009-09-10 + 10:08:00.0"},{"uid":"CDC2A0BA8DF3","startDate":"","kgCO2PerKg":"","kgCO2PerKWh":"","source":"uses + data in /home/energy/electricity","created":"2008-10-22 06:24:32.0","path":"CDC2A0BA8DF3","endDate":"","label":"electricity","kgCO2PerLitre":"","type":"electricity","modified":"2009-09-10 + 10:08:00.0"},{"uid":"66056991EE23","startDate":"","kgCO2PerKg":"2.6935","kgCO2PerKWh":"0.2037","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"66056991EE23","endDate":"","label":"gas","kgCO2PerLitre":"0.0020091","type":"gas","modified":"2009-09-10 + 10:08:00.0"},{"uid":"67D147AF530B","startDate":"","kgCO2PerKg":"2.4269","kgCO2PerKWh":"0.1836","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2009-07-09 + 14:53:18.0","path":"67D147AF530B","endDate":"","label":"gas gross CV","kgCO2PerLitre":"0.0018102","type":"gas + gross CV","modified":"2009-09-10 10:08:00.0"},{"uid":"C024BCE859BB","startDate":"","kgCO2PerKg":"3.1496","kgCO2PerKWh":"0.2584","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"C024BCE859BB","endDate":"","label":"kerosene","kgCO2PerLitre":"2.5278","type":"kerosene","modified":"2009-09-10 + 10:08:00.0"},{"uid":"26709055568C","startDate":"","kgCO2PerKg":"2.9424","kgCO2PerKWh":"0.2255","source":"http://www.defra.gov.uk/environment/business/reporting/pdf/20090717-guidelines-ghg-conversion-factors.xls","created":"2007-07-27 + 09:49:32.0","path":"26709055568C","endDate":"","label":"lpg","kgCO2PerLitre":"1.4951","type":"lpg","modified":"2009-09-10 + 10:08:00.0"}]},"dataCategories":[]}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_Caching_further_down_tree/second_request.yml b/cassettes/AMEE_Connection_Caching_further_down_tree/second_request.yml index 5419f4c..77dc41a 100644 --- a/cassettes/AMEE_Connection_Caching_further_down_tree/second_request.yml +++ b/cassettes/AMEE_Connection_Caching_further_down_tree/second_request.yml @@ -1,79 +1,137 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://stage.amee.com:443/data/home/energy/quantity/878854C275BC - body: - headers: - accept: + uri: https://stage.amee.com/data/home/energy/quantity/878854C275BC + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - authtoken: + Authtoken: - 7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 00:50:38 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 00:50:38 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 00:50:38 GMT - content-length: - - "4140" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i5gyUWNO0eW9IRXPY02HuxqaGx9wJ+fd61ZPXeoEaZhCJDg8Xf959zqYHiHR2AntIo=; Path=/ - authtoken: + Content-Length: + - '4140' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i5gyUWNO0eW9IRXPY02HuxqaGx9wJ+fd61ZPXeoEaZhCJDg8Xf959zqYHiHR2AntIo=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i5gyUWNO0eW9IRXPY02HuxqaGx9wJ+fd61ZPXeoEaZhCJDg8Xf959zqYHiHR2AntIo= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"amount\":{\"unit\":\"kg/year\",\"value\":0},\"amounts\":{\"amount\":[{\"perUnit\":\"year\",\"unit\":\"kg\",\"default\":\"true\",\"value\":0,\"type\":\"CO2\"}]},\"path\":\"/home/energy/quantity/878854C275BC\",\"userValueChoices\":{\"choices\":[{\"name\":\"currentReading\",\"value\":\"0\"},{\"name\":\"energyConsumption\",\"value\":\"0\"},{\"name\":\"greenTariff\",\"value\":\"\"},{\"name\":\"includesHeating\",\"value\":\"false\"},{\"name\":\"lastReading\",\"value\":\"0\"},{\"name\":\"massPerTime\",\"value\":\"0\"},{\"name\":\"deliveries\",\"value\":\"\"},{\"name\":\"paymentFrequency\",\"value\":\"\"},{\"name\":\"season\",\"value\":\"\"},{\"name\":\"volumePerTime\",\"value\":\"0\"}],\"name\":\"userValueChoices\"},\"dataItem\":{\"uid\":\"878854C275BC\",\"startDate\":\"1970-01-01T00:00:00Z\",\"dataCategory\":{\"uid\":\"A92693A99BAD\",\"deprecated\":false,\"name\":\"Quantity\",\"path\":\"quantity\"},\"itemValues\":[{\"itemValueDefinition\":{\"uid\":\"B5AC731EF1D5\",\"name\":\"kgCO2 Per Kg\",\"fromData\":true,\"path\":\"kgCO2PerKg\",\"fromProfile\":false,\"valueDefinition\":{\"uid\":\"F066E097D76D\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"description\":\"\",\"name\":\"kgCO2PerKg\",\"valueType\":\"DECIMAL\",\"modified\":\"2007-07-27 07:30:44.0\"},\"drillDown\":false},\"perUnit\":\"\",\"uid\":\"7071F0E96196\",\"startDate\":\"1970-01-01T00:00:00Z\",\"unit\":\"\",\"name\":\"kgCO2 Per Kg\",\"value\":\"\",\"path\":\"kgCO2PerKg\",\"displayPath\":\"kgCO2PerKg\",\"displayName\":\"kgCO2 Per Kg\"},{\"itemValueDefinition\":{\"uid\":\"469C1AE4B79A\",\"name\":\"kgCO2 Per KWh\",\"fromData\":true,\"path\":\"kgCO2PerKWh\",\"fromProfile\":false,\"valueDefinition\":{\"uid\":\"3EA39C552E81\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"description\":\"\",\"name\":\"kgCO2PerKWh\",\"valueType\":\"DECIMAL\",\"modified\":\"2007-07-27 07:30:44.0\"},\"drillDown\":false},\"perUnit\":\"\",\"uid\":\"1DFEF8E6D7E5\",\"startDate\":\"1970-01-01T00:00:00Z\",\"unit\":\"\",\"name\":\"kgCO2 Per KWh\",\"value\":\"\",\"path\":\"kgCO2PerKWh\",\"displayPath\":\"kgCO2PerKWh\",\"displayName\":\"kgCO2 Per KWh\"},{\"itemValueDefinition\":{\"uid\":\"75DE0251B056\",\"name\":\"Source\",\"fromData\":true,\"path\":\"source\",\"fromProfile\":false,\"valueDefinition\":{\"uid\":\"CCEB59CACE1B\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"description\":\"\",\"name\":\"text\",\"valueType\":\"TEXT\",\"modified\":\"2007-07-27 07:30:44.0\"},\"drillDown\":false},\"perUnit\":\"\",\"uid\":\"015D3ACF02BD\",\"startDate\":\"1970-01-01T00:00:00Z\",\"unit\":\"\",\"name\":\"Source\",\"value\":\"net CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html\",\"path\":\"source\",\"displayPath\":\"source\",\"displayName\":\"Source\"},{\"itemValueDefinition\":{\"uid\":\"EAFBD1CA93E8\",\"name\":\"kgCO2 Per Litre\",\"fromData\":true,\"path\":\"kgCO2PerLitre\",\"fromProfile\":false,\"valueDefinition\":{\"uid\":\"C809A0FE1918\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"description\":\"\",\"name\":\"kgCO2PerLitre\",\"valueType\":\"DECIMAL\",\"modified\":\"2007-07-27 07:30:44.0\"},\"drillDown\":false},\"perUnit\":\"\",\"uid\":\"219EE9D836E0\",\"startDate\":\"1970-01-01T00:00:00Z\",\"unit\":\"\",\"name\":\"kgCO2 Per Litre\",\"value\":\"2.5\",\"path\":\"kgCO2PerLitre\",\"displayPath\":\"kgCO2PerLitre\",\"displayName\":\"kgCO2 Per Litre\"},{\"itemValueDefinition\":{\"uid\":\"5DF1F01B2106\",\"name\":\"Type\",\"fromData\":true,\"path\":\"type\",\"fromProfile\":false,\"valueDefinition\":{\"uid\":\"CCEB59CACE1B\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"description\":\"\",\"name\":\"text\",\"valueType\":\"TEXT\",\"modified\":\"2007-07-27 07:30:44.0\"},\"drillDown\":true},\"perUnit\":\"\",\"uid\":\"5A46861E475C\",\"startDate\":\"1970-01-01T00:00:00Z\",\"unit\":\"\",\"name\":\"Type\",\"value\":\"biodiesel\",\"path\":\"type\",\"displayPath\":\"type\",\"displayName\":\"Type\"}],\"environment\":{\"uid\":\"5F5887BCF726\",\"itemsPerFeed\":10,\"created\":\"Fri Jul 27 08:30:44 UTC 2007\",\"description\":\"\",\"name\":\"AMEE\",\"owner\":\"\",\"path\":\"\",\"itemsPerPage\":10,\"modified\":\"Fri Jul 27 08:30:44 UTC 2007\"},\"created\":\"2007-07-27 09:49:32.0\",\"name\":\"878854C275BC\",\"path\":\"\",\"itemDefinition\":{\"uid\":\"212C818D8F16\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Energy Quantity\",\"drillDown\":\"type\",\"modified\":\"2011-02-16 08:00:50.0\"},\"endDate\":\"\",\"label\":\"biodiesel\",\"modified\":\"2009-09-10 10:08:00.0\"},\"amountPerMonth\":0}" - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","amount":{"unit":"kg/year","value":0},"amounts":{"amount":[{"perUnit":"year","unit":"kg","default":"true","value":0,"type":"CO2"}]},"path":"/home/energy/quantity/878854C275BC","userValueChoices":{"choices":[{"name":"currentReading","value":"0"},{"name":"energyConsumption","value":"0"},{"name":"greenTariff","value":""},{"name":"includesHeating","value":"false"},{"name":"lastReading","value":"0"},{"name":"massPerTime","value":"0"},{"name":"deliveries","value":""},{"name":"paymentFrequency","value":""},{"name":"season","value":""},{"name":"volumePerTime","value":"0"}],"name":"userValueChoices"},"dataItem":{"uid":"878854C275BC","startDate":"1970-01-01T00:00:00Z","dataCategory":{"uid":"A92693A99BAD","deprecated":false,"name":"Quantity","path":"quantity"},"itemValues":[{"itemValueDefinition":{"uid":"B5AC731EF1D5","name":"kgCO2 + Per Kg","fromData":true,"path":"kgCO2PerKg","fromProfile":false,"valueDefinition":{"uid":"F066E097D76D","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","description":"","name":"kgCO2PerKg","valueType":"DECIMAL","modified":"2007-07-27 + 07:30:44.0"},"drillDown":false},"perUnit":"","uid":"7071F0E96196","startDate":"1970-01-01T00:00:00Z","unit":"","name":"kgCO2 + Per Kg","value":"","path":"kgCO2PerKg","displayPath":"kgCO2PerKg","displayName":"kgCO2 + Per Kg"},{"itemValueDefinition":{"uid":"469C1AE4B79A","name":"kgCO2 Per KWh","fromData":true,"path":"kgCO2PerKWh","fromProfile":false,"valueDefinition":{"uid":"3EA39C552E81","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","description":"","name":"kgCO2PerKWh","valueType":"DECIMAL","modified":"2007-07-27 + 07:30:44.0"},"drillDown":false},"perUnit":"","uid":"1DFEF8E6D7E5","startDate":"1970-01-01T00:00:00Z","unit":"","name":"kgCO2 + Per KWh","value":"","path":"kgCO2PerKWh","displayPath":"kgCO2PerKWh","displayName":"kgCO2 + Per KWh"},{"itemValueDefinition":{"uid":"75DE0251B056","name":"Source","fromData":true,"path":"source","fromProfile":false,"valueDefinition":{"uid":"CCEB59CACE1B","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","description":"","name":"text","valueType":"TEXT","modified":"2007-07-27 + 07:30:44.0"},"drillDown":false},"perUnit":"","uid":"015D3ACF02BD","startDate":"1970-01-01T00:00:00Z","unit":"","name":"Source","value":"net + CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html","path":"source","displayPath":"source","displayName":"Source"},{"itemValueDefinition":{"uid":"EAFBD1CA93E8","name":"kgCO2 + Per Litre","fromData":true,"path":"kgCO2PerLitre","fromProfile":false,"valueDefinition":{"uid":"C809A0FE1918","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","description":"","name":"kgCO2PerLitre","valueType":"DECIMAL","modified":"2007-07-27 + 07:30:44.0"},"drillDown":false},"perUnit":"","uid":"219EE9D836E0","startDate":"1970-01-01T00:00:00Z","unit":"","name":"kgCO2 + Per Litre","value":"2.5","path":"kgCO2PerLitre","displayPath":"kgCO2PerLitre","displayName":"kgCO2 + Per Litre"},{"itemValueDefinition":{"uid":"5DF1F01B2106","name":"Type","fromData":true,"path":"type","fromProfile":false,"valueDefinition":{"uid":"CCEB59CACE1B","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","description":"","name":"text","valueType":"TEXT","modified":"2007-07-27 + 07:30:44.0"},"drillDown":true},"perUnit":"","uid":"5A46861E475C","startDate":"1970-01-01T00:00:00Z","unit":"","name":"Type","value":"biodiesel","path":"type","displayPath":"type","displayName":"Type"}],"environment":{"uid":"5F5887BCF726","itemsPerFeed":10,"created":"Fri + Jul 27 08:30:44 UTC 2007","description":"","name":"AMEE","owner":"","path":"","itemsPerPage":10,"modified":"Fri + Jul 27 08:30:44 UTC 2007"},"created":"2007-07-27 09:49:32.0","name":"878854C275BC","path":"","itemDefinition":{"uid":"212C818D8F16","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","name":"Energy Quantity","drillDown":"type","modified":"2011-02-16 + 08:00:50.0"},"endDate":"","label":"biodiesel","modified":"2009-09-10 10:08:00.0"},"amountPerMonth":0}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: get - uri: https://stage.amee.com:443/data/home/energy/quantity/878854C275BC - body: - headers: - accept: + uri: https://stage.amee.com/data/home/energy/quantity/878854C275BC + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - authtoken: + Authtoken: - 7xaj94uNzpKDnVswdfe+cvbyfFn3yqTA9TWYjLkP2okAGu96iA48Y+5uCBBTmsGaCmMFmQk5UY3TtpDSdWzCOsLS2qs1hzx6dNT4+rIr42I= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 00:50:39 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 00:50:39 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 00:50:39 GMT - content-length: - - "4140" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i7MfFEA71I6TSUEqWo4RXzu7SRClW5j2RuTISstOP2pU4NqI9k8Y7Qf8xlNIsj2fas=; Path=/ - authtoken: + Content-Length: + - '4140' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i7MfFEA71I6TSUEqWo4RXzu7SRClW5j2RuTISstOP2pU4NqI9k8Y7Qf8xlNIsj2fas=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4o5danNq168DLVLJpYM3+i7MfFEA71I6TSUEqWo4RXzu7SRClW5j2RuTISstOP2pU4NqI9k8Y7Qf8xlNIsj2fas= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"amount\":{\"unit\":\"kg/year\",\"value\":0},\"amounts\":{\"amount\":[{\"perUnit\":\"year\",\"unit\":\"kg\",\"default\":\"true\",\"value\":0,\"type\":\"CO2\"}]},\"path\":\"/home/energy/quantity/878854C275BC\",\"userValueChoices\":{\"choices\":[{\"name\":\"currentReading\",\"value\":\"0\"},{\"name\":\"energyConsumption\",\"value\":\"0\"},{\"name\":\"greenTariff\",\"value\":\"\"},{\"name\":\"includesHeating\",\"value\":\"false\"},{\"name\":\"lastReading\",\"value\":\"0\"},{\"name\":\"massPerTime\",\"value\":\"0\"},{\"name\":\"deliveries\",\"value\":\"\"},{\"name\":\"paymentFrequency\",\"value\":\"\"},{\"name\":\"season\",\"value\":\"\"},{\"name\":\"volumePerTime\",\"value\":\"0\"}],\"name\":\"userValueChoices\"},\"dataItem\":{\"uid\":\"878854C275BC\",\"startDate\":\"1970-01-01T00:00:00Z\",\"dataCategory\":{\"uid\":\"A92693A99BAD\",\"deprecated\":false,\"name\":\"Quantity\",\"path\":\"quantity\"},\"itemValues\":[{\"itemValueDefinition\":{\"uid\":\"B5AC731EF1D5\",\"name\":\"kgCO2 Per Kg\",\"fromData\":true,\"path\":\"kgCO2PerKg\",\"fromProfile\":false,\"valueDefinition\":{\"uid\":\"F066E097D76D\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"description\":\"\",\"name\":\"kgCO2PerKg\",\"valueType\":\"DECIMAL\",\"modified\":\"2007-07-27 07:30:44.0\"},\"drillDown\":false},\"perUnit\":\"\",\"uid\":\"7071F0E96196\",\"startDate\":\"1970-01-01T00:00:00Z\",\"unit\":\"\",\"name\":\"kgCO2 Per Kg\",\"value\":\"\",\"path\":\"kgCO2PerKg\",\"displayPath\":\"kgCO2PerKg\",\"displayName\":\"kgCO2 Per Kg\"},{\"itemValueDefinition\":{\"uid\":\"469C1AE4B79A\",\"name\":\"kgCO2 Per KWh\",\"fromData\":true,\"path\":\"kgCO2PerKWh\",\"fromProfile\":false,\"valueDefinition\":{\"uid\":\"3EA39C552E81\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"description\":\"\",\"name\":\"kgCO2PerKWh\",\"valueType\":\"DECIMAL\",\"modified\":\"2007-07-27 07:30:44.0\"},\"drillDown\":false},\"perUnit\":\"\",\"uid\":\"1DFEF8E6D7E5\",\"startDate\":\"1970-01-01T00:00:00Z\",\"unit\":\"\",\"name\":\"kgCO2 Per KWh\",\"value\":\"\",\"path\":\"kgCO2PerKWh\",\"displayPath\":\"kgCO2PerKWh\",\"displayName\":\"kgCO2 Per KWh\"},{\"itemValueDefinition\":{\"uid\":\"75DE0251B056\",\"name\":\"Source\",\"fromData\":true,\"path\":\"source\",\"fromProfile\":false,\"valueDefinition\":{\"uid\":\"CCEB59CACE1B\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"description\":\"\",\"name\":\"text\",\"valueType\":\"TEXT\",\"modified\":\"2007-07-27 07:30:44.0\"},\"drillDown\":false},\"perUnit\":\"\",\"uid\":\"015D3ACF02BD\",\"startDate\":\"1970-01-01T00:00:00Z\",\"unit\":\"\",\"name\":\"Source\",\"value\":\"net CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html\",\"path\":\"source\",\"displayPath\":\"source\",\"displayName\":\"Source\"},{\"itemValueDefinition\":{\"uid\":\"EAFBD1CA93E8\",\"name\":\"kgCO2 Per Litre\",\"fromData\":true,\"path\":\"kgCO2PerLitre\",\"fromProfile\":false,\"valueDefinition\":{\"uid\":\"C809A0FE1918\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"description\":\"\",\"name\":\"kgCO2PerLitre\",\"valueType\":\"DECIMAL\",\"modified\":\"2007-07-27 07:30:44.0\"},\"drillDown\":false},\"perUnit\":\"\",\"uid\":\"219EE9D836E0\",\"startDate\":\"1970-01-01T00:00:00Z\",\"unit\":\"\",\"name\":\"kgCO2 Per Litre\",\"value\":\"2.5\",\"path\":\"kgCO2PerLitre\",\"displayPath\":\"kgCO2PerLitre\",\"displayName\":\"kgCO2 Per Litre\"},{\"itemValueDefinition\":{\"uid\":\"5DF1F01B2106\",\"name\":\"Type\",\"fromData\":true,\"path\":\"type\",\"fromProfile\":false,\"valueDefinition\":{\"uid\":\"CCEB59CACE1B\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"description\":\"\",\"name\":\"text\",\"valueType\":\"TEXT\",\"modified\":\"2007-07-27 07:30:44.0\"},\"drillDown\":true},\"perUnit\":\"\",\"uid\":\"5A46861E475C\",\"startDate\":\"1970-01-01T00:00:00Z\",\"unit\":\"\",\"name\":\"Type\",\"value\":\"biodiesel\",\"path\":\"type\",\"displayPath\":\"type\",\"displayName\":\"Type\"}],\"environment\":{\"uid\":\"5F5887BCF726\",\"itemsPerFeed\":10,\"created\":\"Fri Jul 27 08:30:44 UTC 2007\",\"description\":\"\",\"name\":\"AMEE\",\"owner\":\"\",\"path\":\"\",\"itemsPerPage\":10,\"modified\":\"Fri Jul 27 08:30:44 UTC 2007\"},\"created\":\"2007-07-27 09:49:32.0\",\"name\":\"878854C275BC\",\"path\":\"\",\"itemDefinition\":{\"uid\":\"212C818D8F16\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Energy Quantity\",\"drillDown\":\"type\",\"modified\":\"2011-02-16 08:00:50.0\"},\"endDate\":\"\",\"label\":\"biodiesel\",\"modified\":\"2009-09-10 10:08:00.0\"},\"amountPerMonth\":0}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","amount":{"unit":"kg/year","value":0},"amounts":{"amount":[{"perUnit":"year","unit":"kg","default":"true","value":0,"type":"CO2"}]},"path":"/home/energy/quantity/878854C275BC","userValueChoices":{"choices":[{"name":"currentReading","value":"0"},{"name":"energyConsumption","value":"0"},{"name":"greenTariff","value":""},{"name":"includesHeating","value":"false"},{"name":"lastReading","value":"0"},{"name":"massPerTime","value":"0"},{"name":"deliveries","value":""},{"name":"paymentFrequency","value":""},{"name":"season","value":""},{"name":"volumePerTime","value":"0"}],"name":"userValueChoices"},"dataItem":{"uid":"878854C275BC","startDate":"1970-01-01T00:00:00Z","dataCategory":{"uid":"A92693A99BAD","deprecated":false,"name":"Quantity","path":"quantity"},"itemValues":[{"itemValueDefinition":{"uid":"B5AC731EF1D5","name":"kgCO2 + Per Kg","fromData":true,"path":"kgCO2PerKg","fromProfile":false,"valueDefinition":{"uid":"F066E097D76D","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","description":"","name":"kgCO2PerKg","valueType":"DECIMAL","modified":"2007-07-27 + 07:30:44.0"},"drillDown":false},"perUnit":"","uid":"7071F0E96196","startDate":"1970-01-01T00:00:00Z","unit":"","name":"kgCO2 + Per Kg","value":"","path":"kgCO2PerKg","displayPath":"kgCO2PerKg","displayName":"kgCO2 + Per Kg"},{"itemValueDefinition":{"uid":"469C1AE4B79A","name":"kgCO2 Per KWh","fromData":true,"path":"kgCO2PerKWh","fromProfile":false,"valueDefinition":{"uid":"3EA39C552E81","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","description":"","name":"kgCO2PerKWh","valueType":"DECIMAL","modified":"2007-07-27 + 07:30:44.0"},"drillDown":false},"perUnit":"","uid":"1DFEF8E6D7E5","startDate":"1970-01-01T00:00:00Z","unit":"","name":"kgCO2 + Per KWh","value":"","path":"kgCO2PerKWh","displayPath":"kgCO2PerKWh","displayName":"kgCO2 + Per KWh"},{"itemValueDefinition":{"uid":"75DE0251B056","name":"Source","fromData":true,"path":"source","fromProfile":false,"valueDefinition":{"uid":"CCEB59CACE1B","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","description":"","name":"text","valueType":"TEXT","modified":"2007-07-27 + 07:30:44.0"},"drillDown":false},"perUnit":"","uid":"015D3ACF02BD","startDate":"1970-01-01T00:00:00Z","unit":"","name":"Source","value":"net + CV RME-type Wells to wheels/European Commission/JRC 2006 http://ies.jrc.ec.europa.eu/our-activities/support-to-eu-policies/well-to-wheels-analysis/WTW.html","path":"source","displayPath":"source","displayName":"Source"},{"itemValueDefinition":{"uid":"EAFBD1CA93E8","name":"kgCO2 + Per Litre","fromData":true,"path":"kgCO2PerLitre","fromProfile":false,"valueDefinition":{"uid":"C809A0FE1918","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","description":"","name":"kgCO2PerLitre","valueType":"DECIMAL","modified":"2007-07-27 + 07:30:44.0"},"drillDown":false},"perUnit":"","uid":"219EE9D836E0","startDate":"1970-01-01T00:00:00Z","unit":"","name":"kgCO2 + Per Litre","value":"2.5","path":"kgCO2PerLitre","displayPath":"kgCO2PerLitre","displayName":"kgCO2 + Per Litre"},{"itemValueDefinition":{"uid":"5DF1F01B2106","name":"Type","fromData":true,"path":"type","fromProfile":false,"valueDefinition":{"uid":"CCEB59CACE1B","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","description":"","name":"text","valueType":"TEXT","modified":"2007-07-27 + 07:30:44.0"},"drillDown":true},"perUnit":"","uid":"5A46861E475C","startDate":"1970-01-01T00:00:00Z","unit":"","name":"Type","value":"biodiesel","path":"type","displayPath":"type","displayName":"Type"}],"environment":{"uid":"5F5887BCF726","itemsPerFeed":10,"created":"Fri + Jul 27 08:30:44 UTC 2007","description":"","name":"AMEE","owner":"","path":"","itemsPerPage":10,"modified":"Fri + Jul 27 08:30:44 UTC 2007"},"created":"2007-07-27 09:49:32.0","name":"878854C275BC","path":"","itemDefinition":{"uid":"212C818D8F16","environment":{"uid":"5F5887BCF726"},"created":"2007-07-27 + 07:30:44.0","name":"Energy Quantity","drillDown":"type","modified":"2011-02-16 + 08:00:50.0"},"endDate":"","label":"biodiesel","modified":"2009-09-10 10:08:00.0"},"amountPerMonth":0}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication/handling_404s.yml b/cassettes/AMEE_Connection_with_authentication/handling_404s.yml index 08dff36..51fe116 100644 --- a/cassettes/AMEE_Connection_with_authentication/handling_404s.yml +++ b/cassettes/AMEE_Connection_with_authentication/handling_404s.yml @@ -1,69 +1,83 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 01:14:55 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 01:14:55 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:14:55 GMT - set-cookie: - - authToken=ddCIbjrqHdU7lFdl3950alKnoT40xeOsU24Eng/hF5NOV3J+c+c7gDyA6+y7CV8As5aKtbrzw1mmj1ulALGjWjtWfEptjlSOb6qhX/morAs=; Path=/ - authtoken: + Set-Cookie: + - authToken=ddCIbjrqHdU7lFdl3950alKnoT40xeOsU24Eng/hF5NOV3J+c+c7gDyA6+y7CV8As5aKtbrzw1mmj1ulALGjWjtWfEptjlSOb6qhX/morAs=; + Path=/ + Authtoken: - ddCIbjrqHdU7lFdl3950alKnoT40xeOsU24Eng/hF5NOV3J+c+c7gDyA6+y7CV8As5aKtbrzw1mmj1ulALGjWjtWfEptjlSOb6qhX/morAs= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: get - uri: https://stage.amee.com:443/missing_url - body: - headers: - accept: + uri: https://stage.amee.com/missing_url + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=ddCIbjrqHdU7lFdl3950alKnoT40xeOsU24Eng/hF5NOV3J+c+c7gDyA6+y7CV8As5aKtbrzw1mmj1ulALGjWjtWfEptjlSOb6qhX/morAs= - authtoken: + Authtoken: - ddCIbjrqHdU7lFdl3950alKnoT40xeOsU24Eng/hF5NOV3J+c+c7gDyA6+y7CV8As5aKtbrzw1mmj1ulALGjWjtWfEptjlSOb6qhX/morAs= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 404 message: Not Found - headers: - content-type: + headers: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:14:55 GMT - content-length: - - "190" - set-cookie: - - authToken=ddCIbjrqHdU7lFdl3950alKnoT40xeOsU24Eng/hF5NOV3J+c+c7gDyA6+y7CV8As5aKtbrzw1mmj1ulALGjWjtWfEptjlSOb6qhX/morAs=; Path=/ - authtoken: + Content-Length: + - '190' + Set-Cookie: + - authToken=ddCIbjrqHdU7lFdl3950alKnoT40xeOsU24Eng/hF5NOV3J+c+c7gDyA6+y7CV8As5aKtbrzw1mmj1ulALGjWjtWfEptjlSOb6qhX/morAs=; + Path=/ + Authtoken: - ddCIbjrqHdU7lFdl3950alKnoT40xeOsU24Eng/hF5NOV3J+c+c7gDyA6+y7CV8As5aKtbrzw1mmj1ulALGjWjtWfEptjlSOb6qhX/morAs= - body: "{\"status\":{\"description\":\"The server has not found anything matching the request URI\",\"name\":\"Not Found\",\"code\":404,\"uri\":\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5\"}}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"status":{"description":"The server has not found anything matching + the request URI","name":"Not Found","code":404,"uri":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication/hitting_private_urls.yml b/cassettes/AMEE_Connection_with_authentication/hitting_private_urls.yml index ec071d6..5a51dab 100644 --- a/cassettes/AMEE_Connection_with_authentication/hitting_private_urls.yml +++ b/cassettes/AMEE_Connection_with_authentication/hitting_private_urls.yml @@ -1,75 +1,89 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 01:14:29 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 01:14:29 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:14:29 GMT - set-cookie: - - authToken=m9EfzlSsx+o9gnGiWrXmGSOTaiL3GZ9Wz/1/16s8yPximcInyKmBfnNK3v+E7VYvqq1lcePG7xf91awEbH+QcPEmpEYhG+cLl1vyBT+BwXs=; Path=/ - authtoken: + Set-Cookie: + - authToken=m9EfzlSsx+o9gnGiWrXmGSOTaiL3GZ9Wz/1/16s8yPximcInyKmBfnNK3v+E7VYvqq1lcePG7xf91awEbH+QcPEmpEYhG+cLl1vyBT+BwXs=; + Path=/ + Authtoken: - m9EfzlSsx+o9gnGiWrXmGSOTaiL3GZ9Wz/1/16s8yPximcInyKmBfnNK3v+E7VYvqq1lcePG7xf91awEbH+QcPEmpEYhG+cLl1vyBT+BwXs= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: get - uri: https://stage.amee.com:443/data - body: - headers: - accept: + uri: https://stage.amee.com/data + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=m9EfzlSsx+o9gnGiWrXmGSOTaiL3GZ9Wz/1/16s8yPximcInyKmBfnNK3v+E7VYvqq1lcePG7xf91awEbH+QcPEmpEYhG+cLl1vyBT+BwXs= - authtoken: + Authtoken: - m9EfzlSsx+o9gnGiWrXmGSOTaiL3GZ9Wz/1/16s8yPximcInyKmBfnNK3v+E7VYvqq1lcePG7xf91awEbH+QcPEmpEYhG+cLl1vyBT+BwXs= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 01:14:29 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 01:14:29 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:14:29 GMT - content-length: - - "1041" - set-cookie: - - authToken=m9EfzlSsx+o9gnGiWrXmGSOTaiL3GZ9Wz/1/16s8yPximcInyKmBfnNK3v+E7VYvqq1lcePG7xf91awEbH+QcPEmpEYhG+cLl1vyBT+BwXs=; Path=/ - authtoken: + Content-Length: + - '1041' + Set-Cookie: + - authToken=m9EfzlSsx+o9gnGiWrXmGSOTaiL3GZ9Wz/1/16s8yPximcInyKmBfnNK3v+E7VYvqq1lcePG7xf91awEbH+QcPEmpEYhG+cLl1vyBT+BwXs=; + Path=/ + Authtoken: - m9EfzlSsx+o9gnGiWrXmGSOTaiL3GZ9Wz/1/16s8yPximcInyKmBfnNK3v+E7VYvqq1lcePG7xf91awEbH+QcPEmpEYhG+cLl1vyBT+BwXs= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"dataCategory\":{\"uid\":\"CD310BEBAC52\",\"deprecated\":false,\"environment\":{\"uid\":\"5F5887BCF726\",\"itemsPerFeed\":10,\"description\":\"\",\"name\":\"AMEE\",\"owner\":\"\",\"path\":\"\",\"itemsPerPage\":10},\"created\":\"2007-07-27 07:30:44.0\",\"name\":\"Root\",\"path\":\"\",\"modified\":\"2007-07-27 07:30:44.0\"},\"path\":\"\",\"children\":{\"pager\":{},\"dataItems\":{},\"dataCategories\":[{\"uid\":\"99B121BB416C\",\"name\":\"Business\",\"path\":\"business\"},{\"uid\":\"Q9G5P7ZIZXYX\",\"name\":\"Documentation\",\"path\":\"documentation\"},{\"uid\":\"15AC6CF74915\",\"name\":\"Embodied\",\"path\":\"embodied\"},{\"uid\":\"BBA3AC3E795E\",\"name\":\"Home\",\"path\":\"home\"},{\"uid\":\"85A9172C31AF\",\"name\":\"Import\",\"path\":\"import\"},{\"uid\":\"U1X3EBU9QQ2K\",\"name\":\"LCA\",\"path\":\"lca\"},{\"uid\":\"9E5362EAB0E7\",\"name\":\"Metadata\",\"path\":\"metadata\"},{\"uid\":\"A0CF90F6C0B9\",\"name\":\"Personal\",\"path\":\"personal\"},{\"uid\":\"6FF29F7DACDA\",\"name\":\"Planet\",\"path\":\"planet\"},{\"uid\":\"6153F468BE05\",\"name\":\"Test\",\"path\":\"test\"},{\"uid\":\"263FC0186834\",\"name\":\"Transport\",\"path\":\"transport\"},{\"uid\":\"2957AE9B6E6B\",\"name\":\"User\",\"path\":\"user\"}]}}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","dataCategory":{"uid":"CD310BEBAC52","deprecated":false,"environment":{"uid":"5F5887BCF726","itemsPerFeed":10,"description":"","name":"AMEE","owner":"","path":"","itemsPerPage":10},"created":"2007-07-27 + 07:30:44.0","name":"Root","path":"","modified":"2007-07-27 07:30:44.0"},"path":"","children":{"pager":{},"dataItems":{},"dataCategories":[{"uid":"99B121BB416C","name":"Business","path":"business"},{"uid":"Q9G5P7ZIZXYX","name":"Documentation","path":"documentation"},{"uid":"15AC6CF74915","name":"Embodied","path":"embodied"},{"uid":"BBA3AC3E795E","name":"Home","path":"home"},{"uid":"85A9172C31AF","name":"Import","path":"import"},{"uid":"U1X3EBU9QQ2K","name":"LCA","path":"lca"},{"uid":"9E5362EAB0E7","name":"Metadata","path":"metadata"},{"uid":"A0CF90F6C0B9","name":"Personal","path":"personal"},{"uid":"6FF29F7DACDA","name":"Planet","path":"planet"},{"uid":"6153F468BE05","name":"Test","path":"test"},{"uid":"263FC0186834","name":"Transport","path":"transport"},{"uid":"2957AE9B6E6B","name":"User","path":"user"}]}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication/raising_errors_if_permission_denied.yml b/cassettes/AMEE_Connection_with_authentication/raising_errors_if_permission_denied.yml index 3b7cfaa..88045e8 100644 --- a/cassettes/AMEE_Connection_with_authentication/raising_errors_if_permission_denied.yml +++ b/cassettes/AMEE_Connection_with_authentication/raising_errors_if_permission_denied.yml @@ -1,69 +1,82 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 01:15:19 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 01:15:19 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:15:19 GMT - set-cookie: - - authToken=uJ4jlTadT9uSoe3F1+B0vBsTSvLG43P2Wv1UX0FfuvMFQRoMOl2HT0a8P5/pYy7ND6vwyabOh7kU8gNDRabztPL9wWXv7WNWlv9vtk8UTxo=; Path=/ - authtoken: + Set-Cookie: + - authToken=uJ4jlTadT9uSoe3F1+B0vBsTSvLG43P2Wv1UX0FfuvMFQRoMOl2HT0a8P5/pYy7ND6vwyabOh7kU8gNDRabztPL9wWXv7WNWlv9vtk8UTxo=; + Path=/ + Authtoken: - uJ4jlTadT9uSoe3F1+B0vBsTSvLG43P2Wv1UX0FfuvMFQRoMOl2HT0a8P5/pYy7ND6vwyabOh7kU8gNDRabztPL9wWXv7WNWlv9vtk8UTxo= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: get - uri: https://stage.amee.com:443/data/lca/ecoinvent - body: - headers: - accept: + uri: https://stage.amee.com/data/lca/ecoinvent + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=uJ4jlTadT9uSoe3F1+B0vBsTSvLG43P2Wv1UX0FfuvMFQRoMOl2HT0a8P5/pYy7ND6vwyabOh7kU8gNDRabztPL9wWXv7WNWlv9vtk8UTxo= - authtoken: + Authtoken: - uJ4jlTadT9uSoe3F1+B0vBsTSvLG43P2Wv1UX0FfuvMFQRoMOl2HT0a8P5/pYy7ND6vwyabOh7kU8gNDRabztPL9wWXv7WNWlv9vtk8UTxo= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 403 message: Forbidden - headers: - content-type: + headers: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:15:20 GMT - content-length: - - "132" - set-cookie: - - authToken=uJ4jlTadT9uSoe3F1+B0vBsTSvLG43P2Wv1UX0FfuvMFQRoMOl2HT0a8P5/pYy7ND6vwyabOh7kU8gNDRabztPL9wWXv7WNWlv9vtk8UTxo=; Path=/ - authtoken: + Content-Length: + - '132' + Set-Cookie: + - authToken=uJ4jlTadT9uSoe3F1+B0vBsTSvLG43P2Wv1UX0FfuvMFQRoMOl2HT0a8P5/pYy7ND6vwyabOh7kU8gNDRabztPL9wWXv7WNWlv9vtk8UTxo=; + Path=/ + Authtoken: - uJ4jlTadT9uSoe3F1+B0vBsTSvLG43P2Wv1UX0FfuvMFQRoMOl2HT0a8P5/pYy7ND6vwyabOh7kU8gNDRabztPL9wWXv7WNWlv9vtk8UTxo= - body: "{\"status\":{\"description\":\"\",\"name\":\"Forbidden\",\"code\":403,\"uri\":\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4\"}}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"status":{"description":"","name":"Forbidden","code":403,"uri":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4"}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication/should_re-authenticate_and_refresh_authtoken_when_authtoken_expires.yml b/cassettes/AMEE_Connection_with_authentication/should_re-authenticate_and_refresh_authtoken_when_authtoken_expires.yml index bb69e93..692c35d 100644 --- a/cassettes/AMEE_Connection_with_authentication/should_re-authenticate_and_refresh_authtoken_when_authtoken_expires.yml +++ b/cassettes/AMEE_Connection_with_authentication/should_re-authenticate_and_refresh_authtoken_when_authtoken_expires.yml @@ -1,104 +1,141 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://stage.amee.com:443/profiles - body: - headers: - accept: + uri: https://stage.amee.com/profiles + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=old_token - authtoken: + Authtoken: - old_token - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 401 message: Unauthorized - headers: - content-type: + headers: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Thu, 19 Jan 2012 02:37:47 GMT - content-length: - - "175" - body: "{\"status\":{\"description\":\"The request requires user authentication\",\"name\":\"Unauthorized\",\"code\":401,\"uri\":\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2\"}}" - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + Content-Length: + - '175' + body: + encoding: UTF-8 + string: ! '{"status":{"description":"The request requires user authentication","name":"Unauthorized","code":401,"uri":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2"}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: password=&username= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: password=&username= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Wed, 18 Jan 2012 02:37:47 GMT - last-modified: + Last-Modified: - Thu, 19 Jan 2012 02:37:47 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Thu, 19 Jan 2012 02:37:47 GMT - set-cookie: - - authToken=66RMPv4JHsc0nAsLamcVWLj7xkXR/y64cQ/lwvVpRbWMRS/TtCThi4bTwKw+0LwvfbyDIcSER04c5VoBAUBQQJkmPLvYdXi7Y77AvArD0t0=; Path=/ - authtoken: + Set-Cookie: + - authToken=66RMPv4JHsc0nAsLamcVWLj7xkXR/y64cQ/lwvVpRbWMRS/TtCThi4bTwKw+0LwvfbyDIcSER04c5VoBAUBQQJkmPLvYdXi7Y77AvArD0t0=; + Path=/ + Authtoken: - 66RMPv4JHsc0nAsLamcVWLj7xkXR/y64cQ/lwvVpRbWMRS/TtCThi4bTwKw+0LwvfbyDIcSER04c5VoBAUBQQJkmPLvYdXi7Y77AvArD0t0= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: get - uri: https://stage.amee.com:443/profiles - body: - headers: - accept: + uri: https://stage.amee.com/profiles + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=66RMPv4JHsc0nAsLamcVWLj7xkXR/y64cQ/lwvVpRbWMRS/TtCThi4bTwKw+0LwvfbyDIcSER04c5VoBAUBQQJkmPLvYdXi7Y77AvArD0t0= - authtoken: + Authtoken: - 66RMPv4JHsc0nAsLamcVWLj7xkXR/y64cQ/lwvVpRbWMRS/TtCThi4bTwKw+0LwvfbyDIcSER04c5VoBAUBQQJkmPLvYdXi7Y77AvArD0t0= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Wed, 18 Jan 2012 02:37:47 GMT - last-modified: + Last-Modified: - Thu, 19 Jan 2012 02:37:47 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Thu, 19 Jan 2012 02:37:47 GMT - content-length: - - "2523" - set-cookie: - - authToken=66RMPv4JHsc0nAsLamcVWLj7xkXR/y64cQ/lwvVpRbWMRS/TtCThi4bTwKw+0LwvfbyDIcSER04c5VoBAUBQQJkmPLvYdXi7Y77AvArD0t0=; Path=/ - authtoken: + Content-Length: + - '2523' + Set-Cookie: + - authToken=66RMPv4JHsc0nAsLamcVWLj7xkXR/y64cQ/lwvVpRbWMRS/TtCThi4bTwKw+0LwvfbyDIcSER04c5VoBAUBQQJkmPLvYdXi7Y77AvArD0t0=; + Path=/ + Authtoken: - 66RMPv4JHsc0nAsLamcVWLj7xkXR/y64cQ/lwvVpRbWMRS/TtCThi4bTwKw+0LwvfbyDIcSER04c5VoBAUBQQJkmPLvYdXi7Y77AvArD0t0= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"pager\":{\"to\":10,\"lastPage\":5,\"nextPage\":2,\"items\":47,\"start\":0,\"itemsFound\":10,\"requestedPage\":1,\"currentPage\":1,\"from\":1,\"itemsPerPage\":10,\"previousPage\":-1},\"profiles\":[{\"uid\":\"K4CC51L3WX0C\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2012-01-19 02:28:12.0\",\"name\":\"K4CC51L3WX0C\",\"path\":\"K4CC51L3WX0C\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2012-01-19 02:28:12.0\"},{\"uid\":\"7FQIICXECJ0Y\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2012-01-12 22:57:58.0\",\"name\":\"7FQIICXECJ0Y\",\"path\":\"7FQIICXECJ0Y\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2012-01-12 22:57:58.0\"},{\"uid\":\"DTTDCGBH0U8J\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2012-01-12 21:57:40.0\",\"name\":\"DTTDCGBH0U8J\",\"path\":\"DTTDCGBH0U8J\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2012-01-12 21:57:40.0\"},{\"uid\":\"DC38FQ10LTCO\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2012-01-12 21:51:45.0\",\"name\":\"DC38FQ10LTCO\",\"path\":\"DC38FQ10LTCO\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2012-01-12 21:51:45.0\"},{\"uid\":\"8YUXNC2S1KDB\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-28 01:16:13.0\",\"name\":\"8YUXNC2S1KDB\",\"path\":\"8YUXNC2S1KDB\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-28 01:16:13.0\"},{\"uid\":\"S38H6VRASYET\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:59:30.0\",\"name\":\"S38H6VRASYET\",\"path\":\"S38H6VRASYET\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:59:30.0\"},{\"uid\":\"R02I5JB38D0T\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:42:16.0\",\"name\":\"R02I5JB38D0T\",\"path\":\"R02I5JB38D0T\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:42:16.0\"},{\"uid\":\"3Y6QXZXYIVFD\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:19:43.0\",\"name\":\"3Y6QXZXYIVFD\",\"path\":\"3Y6QXZXYIVFD\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:19:43.0\"},{\"uid\":\"G2P9LZY9DMK6\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:18:37.0\",\"name\":\"G2P9LZY9DMK6\",\"path\":\"G2P9LZY9DMK6\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:18:37.0\"},{\"uid\":\"A2L8OG67E9BW\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:13:05.0\",\"name\":\"A2L8OG67E9BW\",\"path\":\"A2L8OG67E9BW\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:13:05.0\"}]}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","pager":{"to":10,"lastPage":5,"nextPage":2,"items":47,"start":0,"itemsFound":10,"requestedPage":1,"currentPage":1,"from":1,"itemsPerPage":10,"previousPage":-1},"profiles":[{"uid":"K4CC51L3WX0C","environment":{"uid":"5F5887BCF726"},"created":"2012-01-19 + 02:28:12.0","name":"K4CC51L3WX0C","path":"K4CC51L3WX0C","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2012-01-19 + 02:28:12.0"},{"uid":"7FQIICXECJ0Y","environment":{"uid":"5F5887BCF726"},"created":"2012-01-12 + 22:57:58.0","name":"7FQIICXECJ0Y","path":"7FQIICXECJ0Y","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2012-01-12 + 22:57:58.0"},{"uid":"DTTDCGBH0U8J","environment":{"uid":"5F5887BCF726"},"created":"2012-01-12 + 21:57:40.0","name":"DTTDCGBH0U8J","path":"DTTDCGBH0U8J","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2012-01-12 + 21:57:40.0"},{"uid":"DC38FQ10LTCO","environment":{"uid":"5F5887BCF726"},"created":"2012-01-12 + 21:51:45.0","name":"DC38FQ10LTCO","path":"DC38FQ10LTCO","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2012-01-12 + 21:51:45.0"},{"uid":"8YUXNC2S1KDB","environment":{"uid":"5F5887BCF726"},"created":"2011-11-28 + 01:16:13.0","name":"8YUXNC2S1KDB","path":"8YUXNC2S1KDB","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-28 + 01:16:13.0"},{"uid":"S38H6VRASYET","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:59:30.0","name":"S38H6VRASYET","path":"S38H6VRASYET","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:59:30.0"},{"uid":"R02I5JB38D0T","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:42:16.0","name":"R02I5JB38D0T","path":"R02I5JB38D0T","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:42:16.0"},{"uid":"3Y6QXZXYIVFD","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:19:43.0","name":"3Y6QXZXYIVFD","path":"3Y6QXZXYIVFD","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:19:43.0"},{"uid":"G2P9LZY9DMK6","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:18:37.0","name":"G2P9LZY9DMK6","path":"G2P9LZY9DMK6","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:18:37.0"},{"uid":"A2L8OG67E9BW","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:13:05.0","name":"A2L8OG67E9BW","path":"A2L8OG67E9BW","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:13:05.0"}]}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication/should_refresh_authtoken_when_authtoken_is_changed.yml b/cassettes/AMEE_Connection_with_authentication/should_refresh_authtoken_when_authtoken_is_changed.yml index ec617fd..d3c5aa5 100644 --- a/cassettes/AMEE_Connection_with_authentication/should_refresh_authtoken_when_authtoken_is_changed.yml +++ b/cassettes/AMEE_Connection_with_authentication/should_refresh_authtoken_when_authtoken_is_changed.yml @@ -1,114 +1,172 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: password=&username= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: password=&username= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Wed, 18 Jan 2012 00:20:52 GMT - last-modified: + Last-Modified: - Thu, 19 Jan 2012 00:20:52 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Thu, 19 Jan 2012 00:20:52 GMT - set-cookie: - - authToken=D86WJz0DmsPOuilmCAswHjVQe2lMzRhpAqFdBk5jSK0UolV0UgRQfTm8xm19lnWTN81vBJ2hW39kwLq8W2JX+sNwY1Fm8Aj8hO+mrkTPkOQ=; Path=/ - authtoken: + Set-Cookie: + - authToken=D86WJz0DmsPOuilmCAswHjVQe2lMzRhpAqFdBk5jSK0UolV0UgRQfTm8xm19lnWTN81vBJ2hW39kwLq8W2JX+sNwY1Fm8Aj8hO+mrkTPkOQ=; + Path=/ + Authtoken: - D86WJz0DmsPOuilmCAswHjVQe2lMzRhpAqFdBk5jSK0UolV0UgRQfTm8xm19lnWTN81vBJ2hW39kwLq8W2JX+sNwY1Fm8Aj8hO+mrkTPkOQ= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: get - uri: https://stage.amee.com:443/profiles - body: - headers: - accept: + uri: https://stage.amee.com/profiles + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=D86WJz0DmsPOuilmCAswHjVQe2lMzRhpAqFdBk5jSK0UolV0UgRQfTm8xm19lnWTN81vBJ2hW39kwLq8W2JX+sNwY1Fm8Aj8hO+mrkTPkOQ= - authtoken: + Authtoken: - D86WJz0DmsPOuilmCAswHjVQe2lMzRhpAqFdBk5jSK0UolV0UgRQfTm8xm19lnWTN81vBJ2hW39kwLq8W2JX+sNwY1Fm8Aj8hO+mrkTPkOQ= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Wed, 18 Jan 2012 00:20:55 GMT - last-modified: + Last-Modified: - Thu, 19 Jan 2012 00:20:55 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Thu, 19 Jan 2012 00:20:55 GMT - content-length: - - "2523" - set-cookie: - - authToken=D86WJz0DmsPOuilmCAswHjVQe2lMzRhpAqFdBk5jSK0UolV0UgRQfTm8xm19lnWTN81vBJ2hW39kwLq8W2JX+sNwY1Fm8Aj8hO+mrkTPkOQ=; Path=/ - authtoken: + Content-Length: + - '2523' + Set-Cookie: + - authToken=D86WJz0DmsPOuilmCAswHjVQe2lMzRhpAqFdBk5jSK0UolV0UgRQfTm8xm19lnWTN81vBJ2hW39kwLq8W2JX+sNwY1Fm8Aj8hO+mrkTPkOQ=; + Path=/ + Authtoken: - D86WJz0DmsPOuilmCAswHjVQe2lMzRhpAqFdBk5jSK0UolV0UgRQfTm8xm19lnWTN81vBJ2hW39kwLq8W2JX+sNwY1Fm8Aj8hO+mrkTPkOQ= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"pager\":{\"to\":10,\"lastPage\":5,\"nextPage\":2,\"items\":46,\"start\":0,\"itemsFound\":10,\"requestedPage\":1,\"currentPage\":1,\"from\":1,\"itemsPerPage\":10,\"previousPage\":-1},\"profiles\":[{\"uid\":\"7FQIICXECJ0Y\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2012-01-12 22:57:58.0\",\"name\":\"7FQIICXECJ0Y\",\"path\":\"7FQIICXECJ0Y\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2012-01-12 22:57:58.0\"},{\"uid\":\"DTTDCGBH0U8J\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2012-01-12 21:57:40.0\",\"name\":\"DTTDCGBH0U8J\",\"path\":\"DTTDCGBH0U8J\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2012-01-12 21:57:40.0\"},{\"uid\":\"DC38FQ10LTCO\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2012-01-12 21:51:45.0\",\"name\":\"DC38FQ10LTCO\",\"path\":\"DC38FQ10LTCO\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2012-01-12 21:51:45.0\"},{\"uid\":\"8YUXNC2S1KDB\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-28 01:16:13.0\",\"name\":\"8YUXNC2S1KDB\",\"path\":\"8YUXNC2S1KDB\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-28 01:16:13.0\"},{\"uid\":\"S38H6VRASYET\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:59:30.0\",\"name\":\"S38H6VRASYET\",\"path\":\"S38H6VRASYET\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:59:30.0\"},{\"uid\":\"R02I5JB38D0T\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:42:16.0\",\"name\":\"R02I5JB38D0T\",\"path\":\"R02I5JB38D0T\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:42:16.0\"},{\"uid\":\"3Y6QXZXYIVFD\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:19:43.0\",\"name\":\"3Y6QXZXYIVFD\",\"path\":\"3Y6QXZXYIVFD\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:19:43.0\"},{\"uid\":\"G2P9LZY9DMK6\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:18:37.0\",\"name\":\"G2P9LZY9DMK6\",\"path\":\"G2P9LZY9DMK6\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:18:37.0\"},{\"uid\":\"A2L8OG67E9BW\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:13:05.0\",\"name\":\"A2L8OG67E9BW\",\"path\":\"A2L8OG67E9BW\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:13:05.0\"},{\"uid\":\"BVZFUUOKT6EF\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:12:41.0\",\"name\":\"BVZFUUOKT6EF\",\"path\":\"BVZFUUOKT6EF\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:12:41.0\"}]}" - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","pager":{"to":10,"lastPage":5,"nextPage":2,"items":46,"start":0,"itemsFound":10,"requestedPage":1,"currentPage":1,"from":1,"itemsPerPage":10,"previousPage":-1},"profiles":[{"uid":"7FQIICXECJ0Y","environment":{"uid":"5F5887BCF726"},"created":"2012-01-12 + 22:57:58.0","name":"7FQIICXECJ0Y","path":"7FQIICXECJ0Y","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2012-01-12 + 22:57:58.0"},{"uid":"DTTDCGBH0U8J","environment":{"uid":"5F5887BCF726"},"created":"2012-01-12 + 21:57:40.0","name":"DTTDCGBH0U8J","path":"DTTDCGBH0U8J","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2012-01-12 + 21:57:40.0"},{"uid":"DC38FQ10LTCO","environment":{"uid":"5F5887BCF726"},"created":"2012-01-12 + 21:51:45.0","name":"DC38FQ10LTCO","path":"DC38FQ10LTCO","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2012-01-12 + 21:51:45.0"},{"uid":"8YUXNC2S1KDB","environment":{"uid":"5F5887BCF726"},"created":"2011-11-28 + 01:16:13.0","name":"8YUXNC2S1KDB","path":"8YUXNC2S1KDB","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-28 + 01:16:13.0"},{"uid":"S38H6VRASYET","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:59:30.0","name":"S38H6VRASYET","path":"S38H6VRASYET","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:59:30.0"},{"uid":"R02I5JB38D0T","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:42:16.0","name":"R02I5JB38D0T","path":"R02I5JB38D0T","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:42:16.0"},{"uid":"3Y6QXZXYIVFD","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:19:43.0","name":"3Y6QXZXYIVFD","path":"3Y6QXZXYIVFD","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:19:43.0"},{"uid":"G2P9LZY9DMK6","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:18:37.0","name":"G2P9LZY9DMK6","path":"G2P9LZY9DMK6","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:18:37.0"},{"uid":"A2L8OG67E9BW","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:13:05.0","name":"A2L8OG67E9BW","path":"A2L8OG67E9BW","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:13:05.0"},{"uid":"BVZFUUOKT6EF","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:12:41.0","name":"BVZFUUOKT6EF","path":"BVZFUUOKT6EF","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:12:41.0"}]}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: get - uri: https://stage.amee.com:443/profiles - body: - headers: - accept: + uri: https://stage.amee.com/profiles + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=D86WJz0DmsPOuilmCAswHjVQe2lMzRhpAqFdBk5jSK0UolV0UgRQfTm8xm19lnWTN81vBJ2hW39kwLq8W2JX+sNwY1Fm8Aj8hO+mrkTPkOQ= - authtoken: + Authtoken: - D86WJz0DmsPOuilmCAswHjVQe2lMzRhpAqFdBk5jSK0UolV0UgRQfTm8xm19lnWTN81vBJ2hW39kwLq8W2JX+sNwY1Fm8Aj8hO+mrkTPkOQ= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Wed, 18 Jan 2012 00:22:01 GMT - last-modified: + Last-Modified: - Thu, 19 Jan 2012 00:22:01 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Thu, 19 Jan 2012 00:22:01 GMT - content-length: - - "2523" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4i4up91Jry+eR4e7QhqswZYtHN7kyvTe/r/tWk6Y6lV8JXXzXeI0Q1Sm+C5BHvo4pcGFATkjS0yCqmt9dbIITIM=; Path=/ - authtoken: + Content-Length: + - '2523' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4i4up91Jry+eR4e7QhqswZYtHN7kyvTe/r/tWk6Y6lV8JXXzXeI0Q1Sm+C5BHvo4pcGFATkjS0yCqmt9dbIITIM=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4i4up91Jry+eR4e7QhqswZYtHN7kyvTe/r/tWk6Y6lV8JXXzXeI0Q1Sm+C5BHvo4pcGFATkjS0yCqmt9dbIITIM= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"pager\":{\"to\":10,\"lastPage\":5,\"nextPage\":2,\"items\":46,\"start\":0,\"itemsFound\":10,\"requestedPage\":1,\"currentPage\":1,\"from\":1,\"itemsPerPage\":10,\"previousPage\":-1},\"profiles\":[{\"uid\":\"7FQIICXECJ0Y\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2012-01-12 22:57:58.0\",\"name\":\"7FQIICXECJ0Y\",\"path\":\"7FQIICXECJ0Y\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2012-01-12 22:57:58.0\"},{\"uid\":\"DTTDCGBH0U8J\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2012-01-12 21:57:40.0\",\"name\":\"DTTDCGBH0U8J\",\"path\":\"DTTDCGBH0U8J\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2012-01-12 21:57:40.0\"},{\"uid\":\"DC38FQ10LTCO\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2012-01-12 21:51:45.0\",\"name\":\"DC38FQ10LTCO\",\"path\":\"DC38FQ10LTCO\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2012-01-12 21:51:45.0\"},{\"uid\":\"8YUXNC2S1KDB\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-28 01:16:13.0\",\"name\":\"8YUXNC2S1KDB\",\"path\":\"8YUXNC2S1KDB\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-28 01:16:13.0\"},{\"uid\":\"S38H6VRASYET\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:59:30.0\",\"name\":\"S38H6VRASYET\",\"path\":\"S38H6VRASYET\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:59:30.0\"},{\"uid\":\"R02I5JB38D0T\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:42:16.0\",\"name\":\"R02I5JB38D0T\",\"path\":\"R02I5JB38D0T\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:42:16.0\"},{\"uid\":\"3Y6QXZXYIVFD\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:19:43.0\",\"name\":\"3Y6QXZXYIVFD\",\"path\":\"3Y6QXZXYIVFD\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:19:43.0\"},{\"uid\":\"G2P9LZY9DMK6\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:18:37.0\",\"name\":\"G2P9LZY9DMK6\",\"path\":\"G2P9LZY9DMK6\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:18:37.0\"},{\"uid\":\"A2L8OG67E9BW\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:13:05.0\",\"name\":\"A2L8OG67E9BW\",\"path\":\"A2L8OG67E9BW\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:13:05.0\"},{\"uid\":\"BVZFUUOKT6EF\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2011-11-25 00:12:41.0\",\"name\":\"BVZFUUOKT6EF\",\"path\":\"BVZFUUOKT6EF\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"2011-11-25 00:12:41.0\"}]}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","pager":{"to":10,"lastPage":5,"nextPage":2,"items":46,"start":0,"itemsFound":10,"requestedPage":1,"currentPage":1,"from":1,"itemsPerPage":10,"previousPage":-1},"profiles":[{"uid":"7FQIICXECJ0Y","environment":{"uid":"5F5887BCF726"},"created":"2012-01-12 + 22:57:58.0","name":"7FQIICXECJ0Y","path":"7FQIICXECJ0Y","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2012-01-12 + 22:57:58.0"},{"uid":"DTTDCGBH0U8J","environment":{"uid":"5F5887BCF726"},"created":"2012-01-12 + 21:57:40.0","name":"DTTDCGBH0U8J","path":"DTTDCGBH0U8J","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2012-01-12 + 21:57:40.0"},{"uid":"DC38FQ10LTCO","environment":{"uid":"5F5887BCF726"},"created":"2012-01-12 + 21:51:45.0","name":"DC38FQ10LTCO","path":"DC38FQ10LTCO","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2012-01-12 + 21:51:45.0"},{"uid":"8YUXNC2S1KDB","environment":{"uid":"5F5887BCF726"},"created":"2011-11-28 + 01:16:13.0","name":"8YUXNC2S1KDB","path":"8YUXNC2S1KDB","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-28 + 01:16:13.0"},{"uid":"S38H6VRASYET","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:59:30.0","name":"S38H6VRASYET","path":"S38H6VRASYET","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:59:30.0"},{"uid":"R02I5JB38D0T","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:42:16.0","name":"R02I5JB38D0T","path":"R02I5JB38D0T","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:42:16.0"},{"uid":"3Y6QXZXYIVFD","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:19:43.0","name":"3Y6QXZXYIVFD","path":"3Y6QXZXYIVFD","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:19:43.0"},{"uid":"G2P9LZY9DMK6","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:18:37.0","name":"G2P9LZY9DMK6","path":"G2P9LZY9DMK6","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:18:37.0"},{"uid":"A2L8OG67E9BW","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:13:05.0","name":"A2L8OG67E9BW","path":"A2L8OG67E9BW","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:13:05.0"},{"uid":"BVZFUUOKT6EF","environment":{"uid":"5F5887BCF726"},"created":"2011-11-25 + 00:12:41.0","name":"BVZFUUOKT6EF","path":"BVZFUUOKT6EF","user":{"uid":"58F26PHHLFEB","username":""},"modified":"2011-11-25 + 00:12:41.0"}]}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication/using_a_v1_key.yml b/cassettes/AMEE_Connection_with_authentication/using_a_v1_key.yml index 47c0c8e..14c61a8 100644 --- a/cassettes/AMEE_Connection_with_authentication/using_a_v1_key.yml +++ b/cassettes/AMEE_Connection_with_authentication/using_a_v1_key.yml @@ -1,71 +1,85 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - last-modified: + headers: + Last-Modified: - Mon, 28 Nov 2011 01:09:43 GMT - expires: + Expires: - Sun, 27 Nov 2011 01:09:43 GMT - via: + Via: - 1.1 stage.amee.com - content-type: + Content-Type: - application/xml; charset=UTF-8 - date: + Date: - Mon, 28 Nov 2011 01:09:43 GMT - server: + Server: - Noelios-Restlet-Engine/1.1.10 - authtoken: + Authtoken: - P64d2f4ShBeIqRrN7uVptSD7jHB2qUPVWxJv4DEuc8oKeYSO3MklQepEbB1TZYE38hHM5XhWOyOsP7ogMsz1z2DyJeIXAUJdLXYcar4Cdbc= - set-cookie: - - authToken=P64d2f4ShBeIqRrN7uVptSD7jHB2qUPVWxJv4DEuc8oKeYSO3MklQepEbB1TZYE38hHM5XhWOyOsP7ogMsz1z2DyJeIXAUJdLXYcar4Cdbc=; Path=/ - vary: + Set-Cookie: + - authToken=P64d2f4ShBeIqRrN7uVptSD7jHB2qUPVWxJv4DEuc8oKeYSO3MklQepEbB1TZYE38hHM5XhWOyOsP7ogMsz1z2DyJeIXAUJdLXYcar4Cdbc=; + Path=/ + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD1.0en_GBUTC - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: /authACTIVESTANDARD1.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Wed, 11 Jan 2012 22:40:34 GMT - last-modified: + Last-Modified: - Thu, 12 Jan 2012 22:40:34 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Thu, 12 Jan 2012 22:40:34 GMT - set-cookie: - - authToken=FKcQNc0p0zYLGePVkhCv7t2FIt8hhTf7ofv8EEvIESAP7KGDCsMOtLYvxcR5qHv3qvgaYTiTuXG/1W8t6CrfigoGsD6SUk5KTQn6ocULcno=; Path=/ - authtoken: + Set-Cookie: + - authToken=FKcQNc0p0zYLGePVkhCv7t2FIt8hhTf7ofv8EEvIESAP7KGDCsMOtLYvxcR5qHv3qvgaYTiTuXG/1W8t6CrfigoGsD6SUk5KTQn6ocULcno=; + Path=/ + Authtoken: - FKcQNc0p0zYLGePVkhCv7t2FIt8hhTf7ofv8EEvIESAP7KGDCsMOtLYvxcR5qHv3qvgaYTiTuXG/1W8t6CrfigoGsD6SUk5KTQn6ocULcno= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD1.0en_GBUTC - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD1.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_JSON.yml b/cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_JSON.yml index 27f9050..fa74c6e 100644 --- a/cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_JSON.yml +++ b/cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_JSON.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 01:08:15 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 01:08:15 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:08:15 GMT - set-cookie: - - authToken=Nb9fPJaHAuaemLpO/LJtK1bJVOLGZ1hTQHyDASyGSVuxX0fZLG40gq+RQdZVJtp9aPHxJmAknZvNNHRd+nXSCvZWRTi39i24rKMN6omqVWA=; Path=/ - authtoken: + Set-Cookie: + - authToken=Nb9fPJaHAuaemLpO/LJtK1bJVOLGZ1hTQHyDASyGSVuxX0fZLG40gq+RQdZVJtp9aPHxJmAknZvNNHRd+nXSCvZWRTi39i24rKMN6omqVWA=; + Path=/ + Authtoken: - Nb9fPJaHAuaemLpO/LJtK1bJVOLGZ1hTQHyDASyGSVuxX0fZLG40gq+RQdZVJtp9aPHxJmAknZvNNHRd+nXSCvZWRTi39i24rKMN6omqVWA= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_XML.yml b/cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_XML.yml index ee4876b..99fb6bb 100644 --- a/cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_XML.yml +++ b/cassettes/AMEE_Connection_with_authentication/using_a_v2_key/detects_the_API_version_for_XML.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 01:09:28 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 01:09:28 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:09:28 GMT - set-cookie: - - authToken=jDUjbvCYE++USQW5cRN1b3Np/3lKnGeL1k0VbsavjpIh6f2xfdoyVDLVyICBsXPH6oFpmcsfOr/YW1NXgpWCxsAy+Q8sTmr6EbyD/dvAZHQ=; Path=/ - authtoken: + Set-Cookie: + - authToken=jDUjbvCYE++USQW5cRN1b3Np/3lKnGeL1k0VbsavjpIh6f2xfdoyVDLVyICBsXPH6oFpmcsfOr/YW1NXgpWCxsAy+Q8sTmr6EbyD/dvAZHQ=; + Path=/ + Authtoken: - jDUjbvCYE++USQW5cRN1b3Np/3lKnGeL1k0VbsavjpIh6f2xfdoyVDLVyICBsXPH6oFpmcsfOr/YW1NXgpWCxsAy+Q8sTmr6EbyD/dvAZHQ= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication_doing_write-requests.yml b/cassettes/AMEE_Connection_with_authentication_doing_write-requests.yml index 2db2287..2d58cb5 100644 --- a/cassettes/AMEE_Connection_with_authentication_doing_write-requests.yml +++ b/cassettes/AMEE_Connection_with_authentication_doing_write-requests.yml @@ -1,75 +1,90 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 01:16:13 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 01:16:13 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:16:13 GMT - set-cookie: - - authToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4=; Path=/ - authtoken: + Set-Cookie: + - authToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4=; + Path=/ + Authtoken: - JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: post - uri: https://stage.amee.com:443/profiles - body: profile=true - headers: - accept: + uri: https://stage.amee.com/profiles + body: + encoding: UTF-8 + string: profile=true + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - authtoken: + Authtoken: - JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 01:16:13 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 01:16:13 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:16:13 GMT - content-length: - - "277" - set-cookie: - - authToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4=; Path=/ - authtoken: + Content-Length: + - '277' + Set-Cookie: + - authToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4=; + Path=/ + Authtoken: - JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"profile\":{\"uid\":\"8YUXNC2S1KDB\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"Mon Nov 28 01:16:13 UTC 2011\",\"name\":\"8YUXNC2S1KDB\",\"path\":\"8YUXNC2S1KDB\",\"user\":{\"uid\":\"58F26PHHLFEB\",\"username\":\"\"},\"modified\":\"Mon Nov 28 01:16:13 UTC 2011\"}}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","profile":{"uid":"8YUXNC2S1KDB","environment":{"uid":"5F5887BCF726"},"created":"Mon + Nov 28 01:16:13 UTC 2011","name":"8YUXNC2S1KDB","path":"8YUXNC2S1KDB","user":{"uid":"58F26PHHLFEB","username":""},"modified":"Mon + Nov 28 01:16:13 UTC 2011"}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/deleting_existing_items.yml b/cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/deleting_existing_items.yml index 13c707a..21575f0 100644 --- a/cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/deleting_existing_items.yml +++ b/cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/deleting_existing_items.yml @@ -1,108 +1,128 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://stage.amee.com:443/data/test/apitests/drill - body: - headers: - accept: + uri: https://stage.amee.com/data/test/apitests/drill + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - authtoken: + Authtoken: - JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 01:19:25 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 01:19:25 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:19:25 GMT - content-length: - - "2867" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyGSM1BOfQ5QkjhaCP1Uw07WEpBSF/CZvkgeLyXTOAWvpbUAVHpdb+xhvrRz6mSM91U=; Path=/ - authtoken: + Content-Length: + - '2867' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyGSM1BOfQ5QkjhaCP1Uw07WEpBSF/CZvkgeLyXTOAWvpbUAVHpdb+xhvrRz6mSM91U=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyGSM1BOfQ5QkjhaCP1Uw07WEpBSF/CZvkgeLyXTOAWvpbUAVHpdb+xhvrRz6mSM91U= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"dataCategory\":{\"uid\":\"039DCB9BA67D\",\"dataCategory\":{\"uid\":\"6153F468BE05\",\"deprecated\":false,\"name\":\"Test\",\"path\":\"test\"},\"deprecated\":false,\"environment\":{\"uid\":\"5F5887BCF726\",\"itemsPerFeed\":10,\"description\":\"\",\"name\":\"AMEE\",\"owner\":\"\",\"path\":\"\",\"itemsPerPage\":10},\"created\":\"2009-08-12 05:19:33.0\",\"name\":\"api tests\",\"path\":\"apitests\",\"itemDefinition\":{\"uid\":\"CF344E20E9AC\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2008-10-28 17:06:33.0\",\"name\":\"AAATipTest\",\"drillDown\":\"question\",\"modified\":\"2008-10-28 17:06:33.0\"},\"modified\":\"2011-05-16 09:37:01.0\"},\"choices\":{\"choices\":[{\"name\":\"0N5G8ZU3WS41\",\"value\":\"0N5G8ZU3WS41\"},{\"name\":\"183FFBE17C25\",\"value\":\"183FFBE17C25\"},{\"name\":\"1CFCEC1A472A\",\"value\":\"1CFCEC1A472A\"},{\"name\":\"2C8F8227A042\",\"value\":\"2C8F8227A042\"},{\"name\":\"37C208E87756\",\"value\":\"37C208E87756\"},{\"name\":\"3D33112A65C0\",\"value\":\"3D33112A65C0\"},{\"name\":\"407ED18C3817\",\"value\":\"407ED18C3817\"},{\"name\":\"41AED8E0EC9E\",\"value\":\"41AED8E0EC9E\"},{\"name\":\"4C2F3C271904\",\"value\":\"4C2F3C271904\"},{\"name\":\"4O7USJN9J2J3\",\"value\":\"4O7USJN9J2J3\"},{\"name\":\"5831AD8B9E7E\",\"value\":\"5831AD8B9E7E\"},{\"name\":\"5832C2374DCD\",\"value\":\"5832C2374DCD\"},{\"name\":\"59948BD49A71\",\"value\":\"59948BD49A71\"},{\"name\":\"5E9B831A406E\",\"value\":\"5E9B831A406E\"},{\"name\":\"5ED64E179495\",\"value\":\"5ED64E179495\"},{\"name\":\"65BFAF323FD5\",\"value\":\"65BFAF323FD5\"},{\"name\":\"73GGRY0D11AJ\",\"value\":\"73GGRY0D11AJ\"},{\"name\":\"8A3B5340BF7A\",\"value\":\"8A3B5340BF7A\"},{\"name\":\"8AC4A5B32373\",\"value\":\"8AC4A5B32373\"},{\"name\":\"9GFREPAVG6HZ\",\"value\":\"9GFREPAVG6HZ\"},{\"name\":\"A54520F7A30B\",\"value\":\"A54520F7A30B\"},{\"name\":\"A604B970190F\",\"value\":\"A604B970190F\"},{\"name\":\"AQ297KQMVM8U\",\"value\":\"AQ297KQMVM8U\"},{\"name\":\"B29847A544D9\",\"value\":\"B29847A544D9\"},{\"name\":\"BA4AA96D1F7F\",\"value\":\"BA4AA96D1F7F\"},{\"name\":\"BC99D35DDB12\",\"value\":\"BC99D35DDB12\"},{\"name\":\"BDD984570CEF\",\"value\":\"BDD984570CEF\"},{\"name\":\"DDCE5C51D3E1\",\"value\":\"DDCE5C51D3E1\"},{\"name\":\"E24G1S1A5U15\",\"value\":\"E24G1S1A5U15\"},{\"name\":\"EFE327521EE1\",\"value\":\"EFE327521EE1\"},{\"name\":\"EYO5KARRH4VI\",\"value\":\"EYO5KARRH4VI\"},{\"name\":\"FB2089863267\",\"value\":\"FB2089863267\"},{\"name\":\"FCEAD07C89F0\",\"value\":\"FCEAD07C89F0\"},{\"name\":\"GPIV5M3F6TWZ\",\"value\":\"GPIV5M3F6TWZ\"},{\"name\":\"KPEZCYPHISO8\",\"value\":\"KPEZCYPHISO8\"},{\"name\":\"L9J8316ZOW3P\",\"value\":\"L9J8316ZOW3P\"},{\"name\":\"LETSBYHU5T3R\",\"value\":\"LETSBYHU5T3R\"},{\"name\":\"N4F33P0U2R27\",\"value\":\"N4F33P0U2R27\"},{\"name\":\"NKYS4OCPGRXN\",\"value\":\"NKYS4OCPGRXN\"},{\"name\":\"RD6GN6RGO7JF\",\"value\":\"RD6GN6RGO7JF\"},{\"name\":\"SNNYQYS1O093\",\"value\":\"SNNYQYS1O093\"},{\"name\":\"STZKIU2EZMWS\",\"value\":\"STZKIU2EZMWS\"},{\"name\":\"T6YG5A92DKJW\",\"value\":\"T6YG5A92DKJW\"},{\"name\":\"U5OS0F2ZXC31\",\"value\":\"U5OS0F2ZXC31\"},{\"name\":\"UU0T33XGU9UZ\",\"value\":\"UU0T33XGU9UZ\"},{\"name\":\"UUKSVHNQJKBW\",\"value\":\"UUKSVHNQJKBW\"}],\"name\":\"uid\"},\"selections\":[{\"name\":\"question\",\"value\":\"\"}],\"itemDefinition\":{\"uid\":\"CF344E20E9AC\"}}" - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","dataCategory":{"uid":"039DCB9BA67D","dataCategory":{"uid":"6153F468BE05","deprecated":false,"name":"Test","path":"test"},"deprecated":false,"environment":{"uid":"5F5887BCF726","itemsPerFeed":10,"description":"","name":"AMEE","owner":"","path":"","itemsPerPage":10},"created":"2009-08-12 + 05:19:33.0","name":"api tests","path":"apitests","itemDefinition":{"uid":"CF344E20E9AC","environment":{"uid":"5F5887BCF726"},"created":"2008-10-28 + 17:06:33.0","name":"AAATipTest","drillDown":"question","modified":"2008-10-28 + 17:06:33.0"},"modified":"2011-05-16 09:37:01.0"},"choices":{"choices":[{"name":"0N5G8ZU3WS41","value":"0N5G8ZU3WS41"},{"name":"183FFBE17C25","value":"183FFBE17C25"},{"name":"1CFCEC1A472A","value":"1CFCEC1A472A"},{"name":"2C8F8227A042","value":"2C8F8227A042"},{"name":"37C208E87756","value":"37C208E87756"},{"name":"3D33112A65C0","value":"3D33112A65C0"},{"name":"407ED18C3817","value":"407ED18C3817"},{"name":"41AED8E0EC9E","value":"41AED8E0EC9E"},{"name":"4C2F3C271904","value":"4C2F3C271904"},{"name":"4O7USJN9J2J3","value":"4O7USJN9J2J3"},{"name":"5831AD8B9E7E","value":"5831AD8B9E7E"},{"name":"5832C2374DCD","value":"5832C2374DCD"},{"name":"59948BD49A71","value":"59948BD49A71"},{"name":"5E9B831A406E","value":"5E9B831A406E"},{"name":"5ED64E179495","value":"5ED64E179495"},{"name":"65BFAF323FD5","value":"65BFAF323FD5"},{"name":"73GGRY0D11AJ","value":"73GGRY0D11AJ"},{"name":"8A3B5340BF7A","value":"8A3B5340BF7A"},{"name":"8AC4A5B32373","value":"8AC4A5B32373"},{"name":"9GFREPAVG6HZ","value":"9GFREPAVG6HZ"},{"name":"A54520F7A30B","value":"A54520F7A30B"},{"name":"A604B970190F","value":"A604B970190F"},{"name":"AQ297KQMVM8U","value":"AQ297KQMVM8U"},{"name":"B29847A544D9","value":"B29847A544D9"},{"name":"BA4AA96D1F7F","value":"BA4AA96D1F7F"},{"name":"BC99D35DDB12","value":"BC99D35DDB12"},{"name":"BDD984570CEF","value":"BDD984570CEF"},{"name":"DDCE5C51D3E1","value":"DDCE5C51D3E1"},{"name":"E24G1S1A5U15","value":"E24G1S1A5U15"},{"name":"EFE327521EE1","value":"EFE327521EE1"},{"name":"EYO5KARRH4VI","value":"EYO5KARRH4VI"},{"name":"FB2089863267","value":"FB2089863267"},{"name":"FCEAD07C89F0","value":"FCEAD07C89F0"},{"name":"GPIV5M3F6TWZ","value":"GPIV5M3F6TWZ"},{"name":"KPEZCYPHISO8","value":"KPEZCYPHISO8"},{"name":"L9J8316ZOW3P","value":"L9J8316ZOW3P"},{"name":"LETSBYHU5T3R","value":"LETSBYHU5T3R"},{"name":"N4F33P0U2R27","value":"N4F33P0U2R27"},{"name":"NKYS4OCPGRXN","value":"NKYS4OCPGRXN"},{"name":"RD6GN6RGO7JF","value":"RD6GN6RGO7JF"},{"name":"SNNYQYS1O093","value":"SNNYQYS1O093"},{"name":"STZKIU2EZMWS","value":"STZKIU2EZMWS"},{"name":"T6YG5A92DKJW","value":"T6YG5A92DKJW"},{"name":"U5OS0F2ZXC31","value":"U5OS0F2ZXC31"},{"name":"UU0T33XGU9UZ","value":"UU0T33XGU9UZ"},{"name":"UUKSVHNQJKBW","value":"UUKSVHNQJKBW"}],"name":"uid"},"selections":[{"name":"question","value":""}],"itemDefinition":{"uid":"CF344E20E9AC"}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: post - uri: https://stage.amee.com:443/profiles/8YUXNC2S1KDB/test/apitests - body: dataItemUid=0N5G8ZU3WS41 - headers: - accept: + uri: https://stage.amee.com/profiles/8YUXNC2S1KDB/test/apitests + body: + encoding: UTF-8 + string: dataItemUid=0N5G8ZU3WS41 + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - authtoken: + Authtoken: - JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 201 message: Created - headers: - location: + headers: + Location: - https://stage.amee.com/profiles/8YUXNC2S1KDB/test/apitests/KSYY092PCNA7 - content-type: + Content-Type: - text/plain - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:19:25 GMT - content-length: - - "0" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyE8JgdGr+4RnkooGQFGURmeckBjVffwJZl5ltq3UKMAwO3oXNMiLNUeNANCEbXFKhU=; Path=/ - authtoken: + Content-Length: + - '0' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyE8JgdGr+4RnkooGQFGURmeckBjVffwJZl5ltq3UKMAwO3oXNMiLNUeNANCEbXFKhU=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyE8JgdGr+4RnkooGQFGURmeckBjVffwJZl5ltq3UKMAwO3oXNMiLNUeNANCEbXFKhU= - body: - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: US-ASCII + string: '' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: delete - uri: https://stage.amee.com:443/profiles/8YUXNC2S1KDB/test/apitests/KSYY092PCNA7 - body: - headers: - accept: + uri: https://stage.amee.com/profiles/8YUXNC2S1KDB/test/apitests/KSYY092PCNA7 + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - authtoken: + Authtoken: - JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - content-type: + headers: + Content-Type: - text/plain - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:19:25 GMT - content-length: - - "0" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyGTEesjk+1uc2VIP7CvFJTMtutyWBcZ1tIdeKIXgCB5c3m9xPVWVBYA+Synm6cMSDU=; Path=/ - authtoken: + Content-Length: + - '0' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyGTEesjk+1uc2VIP7CvFJTMtutyWBcZ1tIdeKIXgCB5c3m9xPVWVBYA+Synm6cMSDU=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyGTEesjk+1uc2VIP7CvFJTMtutyWBcZ1tIdeKIXgCB5c3m9xPVWVBYA+Synm6cMSDU= - body: - http_version: "1.1" + body: + encoding: US-ASCII + string: '' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/sending_updates_to_existing_items.yml b/cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/sending_updates_to_existing_items.yml index 3a50423..0fd906c 100644 --- a/cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/sending_updates_to_existing_items.yml +++ b/cassettes/AMEE_Connection_with_authentication_doing_write-requests/working_with_an_existing_profile/sending_updates_to_existing_items.yml @@ -1,108 +1,128 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: get - uri: https://stage.amee.com:443/data/test/apitests/drill - body: - headers: - accept: + uri: https://stage.amee.com/data/test/apitests/drill + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - authtoken: + Authtoken: - JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Sun, 27 Nov 2011 01:23:55 GMT - last-modified: + Last-Modified: - Mon, 28 Nov 2011 01:23:55 GMT - content-type: + Content-Type: - application/json; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:23:55 GMT - content-length: - - "2867" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyH153tGF7+9g93PnUZfFFlTEgOWFujyW/36QbU3fW5KZEebe88LM1ZnBDGxHHQL2wE=; Path=/ - authtoken: + Content-Length: + - '2867' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyH153tGF7+9g93PnUZfFFlTEgOWFujyW/36QbU3fW5KZEebe88LM1ZnBDGxHHQL2wE=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyH153tGF7+9g93PnUZfFFlTEgOWFujyW/36QbU3fW5KZEebe88LM1ZnBDGxHHQL2wE= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"apiVersion\":\"2.0\",\"dataCategory\":{\"uid\":\"039DCB9BA67D\",\"dataCategory\":{\"uid\":\"6153F468BE05\",\"deprecated\":false,\"name\":\"Test\",\"path\":\"test\"},\"deprecated\":false,\"environment\":{\"uid\":\"5F5887BCF726\",\"itemsPerFeed\":10,\"description\":\"\",\"name\":\"AMEE\",\"owner\":\"\",\"path\":\"\",\"itemsPerPage\":10},\"created\":\"2009-08-12 05:19:33.0\",\"name\":\"api tests\",\"path\":\"apitests\",\"itemDefinition\":{\"uid\":\"CF344E20E9AC\",\"environment\":{\"uid\":\"5F5887BCF726\"},\"created\":\"2008-10-28 17:06:33.0\",\"name\":\"AAATipTest\",\"drillDown\":\"question\",\"modified\":\"2008-10-28 17:06:33.0\"},\"modified\":\"2011-05-16 09:37:01.0\"},\"choices\":{\"choices\":[{\"name\":\"0N5G8ZU3WS41\",\"value\":\"0N5G8ZU3WS41\"},{\"name\":\"183FFBE17C25\",\"value\":\"183FFBE17C25\"},{\"name\":\"1CFCEC1A472A\",\"value\":\"1CFCEC1A472A\"},{\"name\":\"2C8F8227A042\",\"value\":\"2C8F8227A042\"},{\"name\":\"37C208E87756\",\"value\":\"37C208E87756\"},{\"name\":\"3D33112A65C0\",\"value\":\"3D33112A65C0\"},{\"name\":\"407ED18C3817\",\"value\":\"407ED18C3817\"},{\"name\":\"41AED8E0EC9E\",\"value\":\"41AED8E0EC9E\"},{\"name\":\"4C2F3C271904\",\"value\":\"4C2F3C271904\"},{\"name\":\"4O7USJN9J2J3\",\"value\":\"4O7USJN9J2J3\"},{\"name\":\"5831AD8B9E7E\",\"value\":\"5831AD8B9E7E\"},{\"name\":\"5832C2374DCD\",\"value\":\"5832C2374DCD\"},{\"name\":\"59948BD49A71\",\"value\":\"59948BD49A71\"},{\"name\":\"5E9B831A406E\",\"value\":\"5E9B831A406E\"},{\"name\":\"5ED64E179495\",\"value\":\"5ED64E179495\"},{\"name\":\"65BFAF323FD5\",\"value\":\"65BFAF323FD5\"},{\"name\":\"73GGRY0D11AJ\",\"value\":\"73GGRY0D11AJ\"},{\"name\":\"8A3B5340BF7A\",\"value\":\"8A3B5340BF7A\"},{\"name\":\"8AC4A5B32373\",\"value\":\"8AC4A5B32373\"},{\"name\":\"9GFREPAVG6HZ\",\"value\":\"9GFREPAVG6HZ\"},{\"name\":\"A54520F7A30B\",\"value\":\"A54520F7A30B\"},{\"name\":\"A604B970190F\",\"value\":\"A604B970190F\"},{\"name\":\"AQ297KQMVM8U\",\"value\":\"AQ297KQMVM8U\"},{\"name\":\"B29847A544D9\",\"value\":\"B29847A544D9\"},{\"name\":\"BA4AA96D1F7F\",\"value\":\"BA4AA96D1F7F\"},{\"name\":\"BC99D35DDB12\",\"value\":\"BC99D35DDB12\"},{\"name\":\"BDD984570CEF\",\"value\":\"BDD984570CEF\"},{\"name\":\"DDCE5C51D3E1\",\"value\":\"DDCE5C51D3E1\"},{\"name\":\"E24G1S1A5U15\",\"value\":\"E24G1S1A5U15\"},{\"name\":\"EFE327521EE1\",\"value\":\"EFE327521EE1\"},{\"name\":\"EYO5KARRH4VI\",\"value\":\"EYO5KARRH4VI\"},{\"name\":\"FB2089863267\",\"value\":\"FB2089863267\"},{\"name\":\"FCEAD07C89F0\",\"value\":\"FCEAD07C89F0\"},{\"name\":\"GPIV5M3F6TWZ\",\"value\":\"GPIV5M3F6TWZ\"},{\"name\":\"KPEZCYPHISO8\",\"value\":\"KPEZCYPHISO8\"},{\"name\":\"L9J8316ZOW3P\",\"value\":\"L9J8316ZOW3P\"},{\"name\":\"LETSBYHU5T3R\",\"value\":\"LETSBYHU5T3R\"},{\"name\":\"N4F33P0U2R27\",\"value\":\"N4F33P0U2R27\"},{\"name\":\"NKYS4OCPGRXN\",\"value\":\"NKYS4OCPGRXN\"},{\"name\":\"RD6GN6RGO7JF\",\"value\":\"RD6GN6RGO7JF\"},{\"name\":\"SNNYQYS1O093\",\"value\":\"SNNYQYS1O093\"},{\"name\":\"STZKIU2EZMWS\",\"value\":\"STZKIU2EZMWS\"},{\"name\":\"T6YG5A92DKJW\",\"value\":\"T6YG5A92DKJW\"},{\"name\":\"U5OS0F2ZXC31\",\"value\":\"U5OS0F2ZXC31\"},{\"name\":\"UU0T33XGU9UZ\",\"value\":\"UU0T33XGU9UZ\"},{\"name\":\"UUKSVHNQJKBW\",\"value\":\"UUKSVHNQJKBW\"}],\"name\":\"uid\"},\"selections\":[{\"name\":\"question\",\"value\":\"\"}],\"itemDefinition\":{\"uid\":\"CF344E20E9AC\"}}" - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: UTF-8 + string: ! '{"apiVersion":"2.0","dataCategory":{"uid":"039DCB9BA67D","dataCategory":{"uid":"6153F468BE05","deprecated":false,"name":"Test","path":"test"},"deprecated":false,"environment":{"uid":"5F5887BCF726","itemsPerFeed":10,"description":"","name":"AMEE","owner":"","path":"","itemsPerPage":10},"created":"2009-08-12 + 05:19:33.0","name":"api tests","path":"apitests","itemDefinition":{"uid":"CF344E20E9AC","environment":{"uid":"5F5887BCF726"},"created":"2008-10-28 + 17:06:33.0","name":"AAATipTest","drillDown":"question","modified":"2008-10-28 + 17:06:33.0"},"modified":"2011-05-16 09:37:01.0"},"choices":{"choices":[{"name":"0N5G8ZU3WS41","value":"0N5G8ZU3WS41"},{"name":"183FFBE17C25","value":"183FFBE17C25"},{"name":"1CFCEC1A472A","value":"1CFCEC1A472A"},{"name":"2C8F8227A042","value":"2C8F8227A042"},{"name":"37C208E87756","value":"37C208E87756"},{"name":"3D33112A65C0","value":"3D33112A65C0"},{"name":"407ED18C3817","value":"407ED18C3817"},{"name":"41AED8E0EC9E","value":"41AED8E0EC9E"},{"name":"4C2F3C271904","value":"4C2F3C271904"},{"name":"4O7USJN9J2J3","value":"4O7USJN9J2J3"},{"name":"5831AD8B9E7E","value":"5831AD8B9E7E"},{"name":"5832C2374DCD","value":"5832C2374DCD"},{"name":"59948BD49A71","value":"59948BD49A71"},{"name":"5E9B831A406E","value":"5E9B831A406E"},{"name":"5ED64E179495","value":"5ED64E179495"},{"name":"65BFAF323FD5","value":"65BFAF323FD5"},{"name":"73GGRY0D11AJ","value":"73GGRY0D11AJ"},{"name":"8A3B5340BF7A","value":"8A3B5340BF7A"},{"name":"8AC4A5B32373","value":"8AC4A5B32373"},{"name":"9GFREPAVG6HZ","value":"9GFREPAVG6HZ"},{"name":"A54520F7A30B","value":"A54520F7A30B"},{"name":"A604B970190F","value":"A604B970190F"},{"name":"AQ297KQMVM8U","value":"AQ297KQMVM8U"},{"name":"B29847A544D9","value":"B29847A544D9"},{"name":"BA4AA96D1F7F","value":"BA4AA96D1F7F"},{"name":"BC99D35DDB12","value":"BC99D35DDB12"},{"name":"BDD984570CEF","value":"BDD984570CEF"},{"name":"DDCE5C51D3E1","value":"DDCE5C51D3E1"},{"name":"E24G1S1A5U15","value":"E24G1S1A5U15"},{"name":"EFE327521EE1","value":"EFE327521EE1"},{"name":"EYO5KARRH4VI","value":"EYO5KARRH4VI"},{"name":"FB2089863267","value":"FB2089863267"},{"name":"FCEAD07C89F0","value":"FCEAD07C89F0"},{"name":"GPIV5M3F6TWZ","value":"GPIV5M3F6TWZ"},{"name":"KPEZCYPHISO8","value":"KPEZCYPHISO8"},{"name":"L9J8316ZOW3P","value":"L9J8316ZOW3P"},{"name":"LETSBYHU5T3R","value":"LETSBYHU5T3R"},{"name":"N4F33P0U2R27","value":"N4F33P0U2R27"},{"name":"NKYS4OCPGRXN","value":"NKYS4OCPGRXN"},{"name":"RD6GN6RGO7JF","value":"RD6GN6RGO7JF"},{"name":"SNNYQYS1O093","value":"SNNYQYS1O093"},{"name":"STZKIU2EZMWS","value":"STZKIU2EZMWS"},{"name":"T6YG5A92DKJW","value":"T6YG5A92DKJW"},{"name":"U5OS0F2ZXC31","value":"U5OS0F2ZXC31"},{"name":"UU0T33XGU9UZ","value":"UU0T33XGU9UZ"},{"name":"UUKSVHNQJKBW","value":"UUKSVHNQJKBW"}],"name":"uid"},"selections":[{"name":"question","value":""}],"itemDefinition":{"uid":"CF344E20E9AC"}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: post - uri: https://stage.amee.com:443/profiles/8YUXNC2S1KDB/test/apitests - body: dataItemUid=0N5G8ZU3WS41 - headers: - accept: + uri: https://stage.amee.com/profiles/8YUXNC2S1KDB/test/apitests + body: + encoding: UTF-8 + string: dataItemUid=0N5G8ZU3WS41 + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - authtoken: + Authtoken: - JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 201 message: Created - headers: - location: + headers: + Location: - https://stage.amee.com/profiles/8YUXNC2S1KDB/test/apitests/BWVECUBKYLYO - content-type: + Content-Type: - text/plain - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:23:56 GMT - content-length: - - "0" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyEqVhcMQB6jrz2KWs+I9i2oRvyuCilIBBQApC9u/cUpr6RiPxbEpCkJ2+DjCdd9H/Y=; Path=/ - authtoken: + Content-Length: + - '0' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyEqVhcMQB6jrz2KWs+I9i2oRvyuCilIBBQApC9u/cUpr6RiPxbEpCkJ2+DjCdd9H/Y=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyEqVhcMQB6jrz2KWs+I9i2oRvyuCilIBBQApC9u/cUpr6RiPxbEpCkJ2+DjCdd9H/Y= - body: - http_version: "1.1" -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request + body: + encoding: US-ASCII + string: '' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +- request: method: put - uri: https://stage.amee.com:443/profiles/8YUXNC2S1KDB/test/apitests/BWVECUBKYLYO - body: dataItemUid=0N5G8ZU3WS41 - headers: - accept: + uri: https://stage.amee.com/profiles/8YUXNC2S1KDB/test/apitests/BWVECUBKYLYO + body: + encoding: UTF-8 + string: dataItemUid=0N5G8ZU3WS41 + headers: + Accept: - application/json - cookie: + Cookie: - AuthToken=JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - authtoken: + Authtoken: - JbPhZh2bbduzF3r9cGb3YKW3gF4ZHTetT2YmsHksnPbvrzQFhmBfyin7yAJi53zp+N2jWuEK1m9gtIuNcz2u3QZakEjT/SezOAp/DOzn5I4= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - content-type: + headers: + Content-Type: - text/plain - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:23:56 GMT - content-length: - - "0" - set-cookie: - - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyEDld3B5QhnVBpC2ZDdj8H/SJRKlfW02J7qEuKEXqfxpJBZ7PrFAqK0qRp46d5qmK8=; Path=/ - authtoken: + Content-Length: + - '0' + Set-Cookie: + - authToken=/GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyEDld3B5QhnVBpC2ZDdj8H/SJRKlfW02J7qEuKEXqfxpJBZ7PrFAqK0qRp46d5qmK8=; + Path=/ + Authtoken: - /GtLagog4PlDX3b2A4Hn4msb+XB9vhnjNR1dRJXCFyEDld3B5QhnVBpC2ZDdj8H/SJRKlfW02J7qEuKEXqfxpJBZ7PrFAqK0qRp46d5qmK8= - body: - http_version: "1.1" + body: + encoding: US-ASCII + string: '' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_private_url.yml b/cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_private_url.yml index 98bd066..dbd82d0 100644 --- a/cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_private_url.yml +++ b/cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_private_url.yml @@ -1,29 +1,35 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=wrong&password=details - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=wrong&password=details + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - content-type: + headers: + Content-Type: - text/plain - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Mon, 28 Nov 2011 01:25:47 GMT - content-length: - - "0" - set-cookie: + Content-Length: + - '0' + Set-Cookie: - authToken=; Path=/; Expires=Monday, 28-Nov-11 01:25:47 GMT - authToken=; Path=/; Expires=Monday, 28-Nov-11 01:25:47 GMT - body: - http_version: "1.1" + body: + encoding: US-ASCII + string: '' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_public_url.yml b/cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_public_url.yml index cdcd98a..903bd7d 100644 --- a/cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_public_url.yml +++ b/cassettes/AMEE_Connection_with_bad_authentication_information/hitting_a_public_url.yml @@ -1,32 +1,41 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request - method: :get - uri: https://stage.amee.com:443/ - body: - headers: - accept: +--- +http_interactions: +- request: + method: get + uri: https://stage.amee.com/ + body: + encoding: US-ASCII + string: '' + headers: + Accept: - application/json - cookie: + Cookie: - authToken= - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 406 message: Not Acceptable - headers: - via: + headers: + Via: - 1.1 stage.amee.com - content-type: + Content-Type: - application/json; charset=UTF-8 - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Wed, 23 Nov 2011 10:29:09 GMT - content-length: - - "325" - set-cookie: + Content-Length: + - '325' + Set-Cookie: - authToken=; Path=/; Expires=Wednesday, 23-Nov-11 10:29:09 GMT - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - body: "{\"status\":{\"description\":\"The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request\",\"name\":\"Not Acceptable\",\"code\":406,\"uri\":\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7\"}}" - http_version: "1.1" + body: + encoding: UTF-8 + string: ! '{"status":{"description":"The resource identified by the request + is only capable of generating response entities which have content characteristics + not acceptable according to the accept headers sent in the request","name":"Not + Acceptable","code":406,"uri":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7"}}' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_incorrect_server_name.yml b/cassettes/AMEE_Connection_with_incorrect_server_name.yml index 20fe07d..8e5bc04 100644 --- a/cassettes/AMEE_Connection_with_incorrect_server_name.yml +++ b/cassettes/AMEE_Connection_with_incorrect_server_name.yml @@ -1,16 +1,22 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://badservername.example.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://badservername.example.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 0 message: - headers: - body: - http_version: "1.1" + headers: {} + body: + encoding: US-ASCII + string: '' + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/cassettes/AMEE_Connection_with_retry_enabled.yml b/cassettes/AMEE_Connection_with_retry_enabled.yml index eb2dec8..8d1a317 100644 --- a/cassettes/AMEE_Connection_with_retry_enabled.yml +++ b/cassettes/AMEE_Connection_with_retry_enabled.yml @@ -1,36 +1,44 @@ ---- -- !ruby/struct:VCR::HTTPInteraction - request: !ruby/struct:VCR::Request +--- +http_interactions: +- request: method: post - uri: https://stage.amee.com:443/auth/signIn - body: username=&password= - headers: - accept: + uri: https://stage.amee.com/auth/signIn + body: + encoding: UTF-8 + string: username=&password= + headers: + Accept: - application/xml - response: !ruby/struct:VCR::Response - status: !ruby/struct:VCR::ResponseStatus + response: + status: code: 200 message: OK - headers: - expires: + headers: + Expires: - Mon, 28 Nov 2011 01:13:17 GMT - last-modified: + Last-Modified: - Tue, 29 Nov 2011 01:13:17 GMT - content-type: + Content-Type: - application/xml; charset=UTF-8 - via: + Via: - 1.1 stage.amee.com - server: + Server: - Noelios-Restlet-Engine/1.1.10 - date: + Date: - Tue, 29 Nov 2011 01:13:17 GMT - set-cookie: - - authToken=/0ofRZmnfXmNbI9NOWg5uGZVX6nP7DFKDSeOUuVGhASi0NxWpogmzumJHmHi8YuNKEKYAD0qOiNJcq8R5vncNvJiW0Vtzn3IYEDvt+wYkGY=; Path=/ - authtoken: + Set-Cookie: + - authToken=/0ofRZmnfXmNbI9NOWg5uGZVX6nP7DFKDSeOUuVGhASi0NxWpogmzumJHmHi8YuNKEKYAD0qOiNJcq8R5vncNvJiW0Vtzn3IYEDvt+wYkGY=; + Path=/ + Authtoken: - /0ofRZmnfXmNbI9NOWg5uGZVX6nP7DFKDSeOUuVGhASi0NxWpogmzumJHmHi8YuNKEKYAD0qOiNJcq8R5vncNvJiW0Vtzn3IYEDvt+wYkGY= - vary: + Vary: - Accept-Charset,Accept-Encoding,Accept-Language,Accept - transfer-encoding: + Transfer-Encoding: - chunked - body: /authACTIVESTANDARD2.0en_GBUTC - http_version: "1.1" + body: + encoding: UTF-8 + string: /authACTIVESTANDARD2.0en_GBUTC + http_version: '1.1' + recorded_at: Fri, 03 Apr 2015 12:11:33 GMT +recorded_with: VCR 2.9.3 diff --git a/lib/amee/collection.rb b/lib/amee/collection.rb index 8766578..16c7fb9 100644 --- a/lib/amee/collection.rb +++ b/lib/amee/collection.rb @@ -16,10 +16,8 @@ def initialize(connection, options = {}, &block) parse_page end rescue JSONParseError, XMLParseError - @connection.expire(collectionpath) raise AMEE::BadData.new("Couldn't load #{self.class.name}.\n#{@response}") rescue AMEE::BadData - @connection.expire(collectionpath) raise end @@ -56,7 +54,6 @@ def fetch @doc = load_xml_doc(@response) end rescue JSON::ParserError, Nokogiri::XML::SyntaxError - @connection.expire(collectionpath) if delay = retries.shift sleep delay retry diff --git a/lib/amee/connection.rb b/lib/amee/connection.rb index 27805b6..c3b1eb8 100644 --- a/lib/amee/connection.rb +++ b/lib/amee/connection.rb @@ -33,30 +33,6 @@ def initialize(server, username, password, options = {}) raise "You must supply connection details - server, username and password are all required!" end - # Working with caching - - # Handle old option - if options[:enable_caching] - Kernel.warn '[DEPRECATED] :enable_caching => true is deprecated. Use :cache => :memory_store instead' - options[:cache] ||= :memory_store - end - # Create cache store - if options[:cache] && - (options[:cache_store].class.name == "ActiveSupport::Cache::MemCacheStore" || - options[:cache].to_sym == :mem_cache_store) - raise 'ActiveSupport::Cache::MemCacheStore is not supported, as it doesn\'t allow regexp expiry' - end - if options[:cache_store].is_a?(ActiveSupport::Cache::Store) - # Allows assignment of the entire cache store in Rails apps - @cache = options[:cache_store] - elsif options[:cache] - if options[:cache_options] - @cache = ActiveSupport::Cache.lookup_store(options[:cache].to_sym, options[:cache_options]) - else - @cache = ActiveSupport::Cache.lookup_store(options[:cache].to_sym) - end - end - # set up hash to pass to builder block @params = { :ssl => @ssl, @@ -91,7 +67,6 @@ def timeout=(t) end def version - authenticate if @version.nil? @version end @@ -111,21 +86,20 @@ def get(path, data = {}) # Add parameters to URL query string get_params = { :method => "get", - :verbose => DEBUG + :verbose => DEBUG, + :userpwd => "#{username}:#{password}" } get_params[:params] = data unless data.empty? # Create GET request get = Typhoeus::Request.new("#{protocol}#{@server}#{path}", get_params) # Send request - do_request(get, format, :cache => true) + do_request(get, format) end # POST to the AMEE API, passing in a hash of values def post(path, data = {}) # Allow format override format = data.delete(:format) || @format - # Clear cache - expire_matching "#{raw_path(path)}.*" # Extract return unit params query_params = {} query_params[:returnUnit] = data.delete(:returnUnit) if data[:returnUnit] @@ -146,8 +120,6 @@ def post(path, data = {}) def raw_post(path, body, options = {}) # Allow format override format = options.delete(:format) || @format - # Clear cache - expire_matching "#{raw_path(path)}.*" # Create POST request post = Typhoeus::Request.new("#{protocol}#{@server}#{path}", :verbose => DEBUG, @@ -164,8 +136,6 @@ def raw_post(path, body, options = {}) def put(path, data = {}) # Allow format override format = data.delete(:format) || @format - # Clear cache - expire_matching "#{parent_path(path)}.*" # Extract return unit params query_params = {} query_params[:returnUnit] = data.delete(:returnUnit) if data[:returnUnit] @@ -186,8 +156,6 @@ def put(path, data = {}) def raw_put(path, body, options = {}) # Allow format override format = options.delete(:format) || @format - # Clear cache - expire_matching "#{parent_path(path)}.*" # Create PUT request put = Typhoeus::Request.new("#{protocol}#{@server}#{path}", :verbose => DEBUG, @@ -200,8 +168,6 @@ def raw_put(path, body, options = {}) end def delete(path) - # Clear cache - expire_matching "#{parent_path(path)}.*" # Create DELETE request delete = Typhoeus::Request.new("#{protocol}#{@server}#{path}", :verbose => DEBUG, @@ -300,21 +266,20 @@ def response_ok?(response, request) case response.code.to_i when 502, 503, 504 - raise AMEE::ConnectionFailed.new("A connection error occurred while talking to AMEE: HTTP response code #{response.code}.\nRequest: #{request.method.upcase} #{request.url.gsub(request.host, '')}") + raise AMEE::ConnectionFailed.new("A connection error occurred while talking to AMEE: HTTP response code #{response.code}.\nRequest: #{request.options[:method].upcase} #{request.url}") when 408 raise AMEE::TimeOut.new("Request timed out.") when 404 - raise AMEE::NotFound.new("The URL was not found on the server.\nRequest: #{request.method.upcase} #{request.url.gsub(request.host, '')}") + raise AMEE::NotFound.new("The URL was not found on the server.\nRequest: #{request.options[:method].upcase} #{request.url}") when 403 - raise AMEE::PermissionDenied.new("You do not have permission to perform the requested operation.\nRequest: #{request.method.upcase} #{request.url.gsub(request.host, '')}\n#{request.body}\Response: #{response.body}") + raise AMEE::PermissionDenied.new("You do not have permission to perform the requested operation.\nRequest: #{request.options[:method].upcase} #{request.url}\n#{request.options[:body]}\Response: #{response.body}") when 401 - authenticate - return false + raise AMEE::PermissionDenied.new("Not authenticated.\nRequest: #{request.options[:method].upcase} #{request.url}\n#{request.options[:body]}\Response: #{response.body}") when 400 if response.body.include? "would have resulted in a duplicate resource being created" - raise AMEE::DuplicateResource.new("The specified resource already exists. This is most often caused by creating an item that overlaps another in time.\nRequest: #{request.method.upcase} #{request.url.gsub(request.host, '')}\n#{request.body}\Response: #{response.body}") + raise AMEE::DuplicateResource.new("The specified resource already exists. This is most often caused by creating an item that overlaps another in time.\nRequest: #{request.options[:method].upcase} #{request.url}\n#{request.options[:body]}\Response: #{response.body}") else - raise AMEE::BadRequest.new("Bad request. This is probably due to malformed input data.\nRequest: #{request.method.upcase} #{request.url.gsub(request.host, '')}\n#{request.body}\Response: #{response.body}") + raise AMEE::BadRequest.new("Bad request. This is probably due to malformed input data.\nRequest: #{request.options[:method].upcase} #{request.url}\n#{request.options[:body]}\Response: #{response.body}") end when 200, 201, 204 return response @@ -322,7 +287,7 @@ def response_ok?(response, request) connection_failed end # If we get here, something unhandled has happened, so raise an unknown error. - raise AMEE::UnknownError.new("An error occurred while talking to AMEE: HTTP response code #{response.code}.\nRequest: #{request.method.upcase} #{request.url}\n#{request.body}\Response: #{response.body}") + raise AMEE::UnknownError.new("An error occurred while talking to AMEE: HTTP response code #{response.code}.\nRequest: #{request.options[:method].upcase} #{request.url}\n#{request.options[:body]}\Response: #{response.body}") end # Wrapper for sending requests through to the API. @@ -330,38 +295,21 @@ def response_ok?(response, request) # if set, attempts to retry a number of times set when # initialising the class def do_request(request, format = @format, options = {}) - - # Is this a v3 request? - v3_request = request.url.include?("/#{v3_hostname}/") - - # make sure we have our auth token before we start - # any v1 or v2 requests - if !@auth_token && !v3_request - d "Authenticating first before we hit #{request.url}" - authenticate - end - - request.headers['Accept'] = content_type(format) + request.options[:headers]['Accept'] = content_type(format) # Set AMEE source header if set - request.headers['X-AMEE-Source'] = @amee_source if @amee_source + request.options[:headers]['X-AMEE-Source'] = @amee_source if @amee_source # path+query string only (split with an int limits the number of splits) path_and_query = '/' + request.url.split('/', 4)[3] - if options[:cache] - # Get response with caching - response = cache(path_and_query) { run_request(request, :xml) } - else - response = run_request(request, :xml) - end - response + run_request(request, :xml) end # run request. Extracted from do_request to make # cache code simpler def run_request(request, format) # Is this a v3 request? - v3_request = request.url.include?("/#{v3_hostname}/") + v3_request = true # Execute with retries retries = [1] * @retries begin @@ -390,25 +338,13 @@ def run_request(request, format) # making a request anyway def add_authentication_to(request=nil) if @auth_token - request.headers['Cookie'] = "AuthToken=#{@auth_token}" - request.headers['AuthToken'] = @auth_token + request.options[:headers]['Cookie'] = "AuthToken=#{@auth_token}" + request.options[:headers]['AuthToken'] = @auth_token else raise "The connection can't authenticate. Check if the auth_token is being set by the server" end end - def cache(path, &block) - key = cache_key(path) - if @cache && @cache.exist?(key) - d "CACHE HIT on #{key}" if @debug - return @cache.read(key) - end - d "CACHE MISS on #{key}" if @debug - data = block.call - @cache.write(key, data) if @cache - return data - end - def parent_path(path) path.split('/')[0..-2].join('/') end @@ -416,33 +352,5 @@ def parent_path(path) def raw_path(path) path.split(/[;?]/)[0] end - - def cache_key(path) - # Remote special characters from key names - key = @server + path.gsub(/[^0-9a-z\/]/i, '').gsub(/\//i, '_') - # Work around Rails bug #4907 https://github.com/rails/rails/issues/4907 - # Rails chunks the key into 230-char sections, but has a bug if - # eventual filename length are 229 or 230, so we check and add - # a pad if this would be the case. - if (key.length % 230 == 229 || key.length % 230 == 0) - key += 'xx' - end - key - end - - public - - def expire(path, options = nil) - @cache.delete(cache_key(path), options) if @cache - end - - def expire_matching(matcher, options = nil) - @cache.delete_matched(Regexp.new(cache_key(matcher)), options) if @cache - end - - def expire_all - @cache.clear if @cache - end - end end diff --git a/lib/amee/data_item.rb b/lib/amee/data_item.rb index d9c5c9d..a14d8f2 100644 --- a/lib/amee/data_item.rb +++ b/lib/amee/data_item.rb @@ -37,75 +37,12 @@ def item_definition @item_definition ||= AMEE::Admin::ItemDefinition.load(connection,item_definition_uid) end - - def self.from_json(json) - # Read JSON - doc = JSON.parse(json) - begin - data = {} - data[:uid] = doc['dataItem']['uid'] - data[:created] = DateTime.parse(doc['dataItem']['created']) - data[:modified] = DateTime.parse(doc['dataItem']['modified']) - data[:name] = doc['dataItem']['name'] - data[:path] = doc['path'] - data[:label] = doc['dataItem']['label'] - data[:item_definition] = doc['dataItem']['itemDefinition']['uid'] - data[:category_uid] = doc['dataItem']['dataCategory']['uid'] - # Read v2 total - data[:total_amount] = doc['amount']['value'] rescue nil - data[:total_amount_unit] = doc['amount']['unit'] rescue nil - # Read v1 total - if data[:total_amount].nil? - data[:total_amount] = doc['amountPerMonth'] rescue nil - data[:total_amount_unit] = "kg/month" - end - # Read amounts - if doc['amounts'] - if doc['amounts']['amount'] - data[:amounts] = doc['amounts']['amount'].map do |item| - { - :type => item['type'], - :value => item['value'].to_f, - :unit => item['unit'], - :per_unit => item['perUnit'], - :default => (item['default'] == 'true'), - } - end - end - if doc['amounts']['note'] - data[:notes] = doc['amounts']['note'].map do |item| - { - :type => item['type'], - :value => item['value'], - } - end - end - end - # Get values - data[:values] = [] - doc['dataItem']['itemValues'].each do |value| - value_data = {} - value_data[:name] = value['name'] - value_data[:path] = value['path'] - value_data[:value] = value['value'] - value_data[:drill] = value['itemValueDefinition']['drillDown'] rescue nil - value_data[:uid] = value['uid'] - data[:values] << value_data - end - # Get choices - data[:choices] = [] - doc['userValueChoices']['choices'].each do |choice| - choice_data = {} - choice_data[:name] = choice['name'] - choice_data[:value] = choice['value'] - data[:choices] << choice_data - end - data[:start_date] = DateTime.parse(doc['dataItem']['startDate']) rescue nil - # Create object - Item.new(data) - rescue - raise AMEE::BadData.new("Couldn't load DataItem from JSON. Check that your URL is correct.\n#{json}") - end + def self.from_json(body) + json = JSON.parse(body, :symbolize_names => true) + new({ + amounts: json[:output][:amounts], + notes: json[:output][:notes] + }) end def self.from_xml(xml) @@ -176,7 +113,7 @@ def self.from_xml(xml) def self.get(connection, path, options = {}) # Load data from path - item= get_and_parse(connection, path, options) + item = get_and_parse(connection, path, options) # Store connection in object for future use item.connection = connection # Done diff --git a/lib/amee/object.rb b/lib/amee/object.rb index 36bb69a..f1aa127 100644 --- a/lib/amee/object.rb +++ b/lib/amee/object.rb @@ -21,10 +21,6 @@ def initialize(data = nil) attr_reader :path attr_reader :name - def expire_cache - @connection.expire_matching(full_path+'.*') - end - # A nice shared get/parse handler that handles retry on parse errors def self.get_and_parse(connection, path, options) # Note that we don't check the number of times retry has been done lower down @@ -43,18 +39,14 @@ def self.get_and_parse(connection, path, options) end rescue JSON::ParserError, Nokogiri::XML::SyntaxError, REXML::ParseException => e # Invalid JSON or XML received, try the GET again in case it got cut off mid-stream - connection.expire(path) if delay = retries.shift sleep delay retry else raise end - rescue AMEE::BadData - connection.expire(path) - raise end end end -end \ No newline at end of file +end diff --git a/lib/amee/rails.rb b/lib/amee/rails.rb index 8994091..4ba00ab 100644 --- a/lib/amee/rails.rb +++ b/lib/amee/rails.rb @@ -29,12 +29,6 @@ def self.global(options = {}) if $AMEE_CONFIG[:timeout] options.merge! :timeout => $AMEE_CONFIG[:timeout].to_i end - if $AMEE_CONFIG[:cache] == 'rails' - # Pass in the rails cache store - options[:cache_store] = ActionController::Base.cache_store - else - options[:cache] ||= $AMEE_CONFIG[:cache] if $AMEE_CONFIG[:cache].present? - end options[:enable_debug] ||= $AMEE_CONFIG[:debug] if $AMEE_CONFIG[:debug].present? @connection = self.connect($AMEE_CONFIG[:server], $AMEE_CONFIG[:username], $AMEE_CONFIG[:password], options) # Also store as $amee for backwards compatibility, though this is now deprecated @@ -42,11 +36,11 @@ def self.global(options = {}) end @connection end + protected + def self.connect(server, username, password, options) - connection = AMEE::Connection.new(server, username, password, options) - connection.authenticate unless options[:authenticate] == false - return connection + AMEE::Connection.new(server, username, password, options) end end @@ -104,4 +98,4 @@ def global_amee_connection(options={}) AMEE::Rails.connection(options) end end -end \ No newline at end of file +end diff --git a/lib/amee/v3/connection.rb b/lib/amee/v3/connection.rb index 708d361..670659f 100644 --- a/lib/amee/v3/connection.rb +++ b/lib/amee/v3/connection.rb @@ -19,15 +19,13 @@ def v3_get(path, options = {}) :method => "get" } get_params[:params] = options unless options.empty? - # Send request (with caching) - v3_do_request(get_params, path, :cache => true) + # Send request + v3_do_request(get_params, path) end # Perform a PUT request # options hash should contain request body parameters def v3_put(path, options = {}) - # Expire cached objects from parent on down - expire_matching "#{parent_path(path)}.*" # Create request parameters put_params = { :method => "put", @@ -47,8 +45,6 @@ def v3_put(path, options = {}) # It can also contain a :returnobj parameter which will cause # a full reponse object to be returned instead of just the body def v3_post(path, options = {}) - # Expire cached objects from here on down - expire_matching "#{raw_path(path)}.*" # Get 'return full response object' flag return_obj = options.delete(:returnobj) || false # Create request parameters @@ -67,8 +63,6 @@ def v3_post(path, options = {}) # Perform a POST request def v3_delete(path) - # Expire cached objects from here on down - expire_matching "#{parent_path(path)}.*" # Create request parameters delete_params = { :method => "delete" @@ -83,9 +77,8 @@ def v3_delete(path) def v3_defaults { :verbose => DEBUG, - :follow_location => true, - :username => @username, - :password => @password + :followlocation => true, + :userpwd => "#{@username}:#{@password}" } end @@ -98,15 +91,7 @@ def v3_do_request(params, path, options = {}) # Work out v3 hostname corresponding to v2 hostname def v3_hostname - unless @server.starts_with?("platform-api-") - if @server.starts_with?("platform-") - @server.gsub("platform-", "platform-api-") - else - "platform-api-#{@server}" - end - else - @server - end + @server end end diff --git a/lib/amee/v3/item_definition.rb b/lib/amee/v3/item_definition.rb index 163fe74..51859ba 100644 --- a/lib/amee/v3/item_definition.rb +++ b/lib/amee/v3/item_definition.rb @@ -71,12 +71,6 @@ def save! } @connection.v3_put("/#{AMEE::Connection.api_version}/definitions/#{@uid}",save_options) end - - alias_method :expire_cache_without_v3, :expire_cache - def expire_cache - @connection.expire_matching("/#{AMEE::Connection.api_version}/definitions/#{@uid}.*") - expire_cache_without_v3 - end end end end diff --git a/lib/amee/v3/item_value_definition.rb b/lib/amee/v3/item_value_definition.rb index 3a81261..2a633b2 100644 --- a/lib/amee/v3/item_value_definition.rb +++ b/lib/amee/v3/item_value_definition.rb @@ -87,12 +87,6 @@ def default @default end end - - alias_method :expire_cache_without_v3, :expire_cache - def expire_cache - @connection.expire_matching("/#{AMEE::Connection.api_version}/definitions/#{itemdefuid}/values/#{uid}.*") - expire_cache_without_v3 - end end end -end \ No newline at end of file +end diff --git a/spec/cache_spec.rb b/spec/cache_spec.rb deleted file mode 100644 index 961ecbf..0000000 --- a/spec/cache_spec.rb +++ /dev/null @@ -1,233 +0,0 @@ -# Copyright (C) 2008-2013 AMEE UK Ltd. - http://www.amee.com -# Released as Open Source Software under the BSD 3-Clause license. See LICENSE.txt for details. - -require 'spec_helper.rb' -require 'ostruct' - -describe AMEE::Connection do - - describe 'without caching' do - - it "doesn't cache GET requests" do - VCR.use_cassette("AMEE_Connection_Caching_Off/logging_in") do - @connection = AMEE::Connection.new("stage.amee.com", "amee_ruby_vcr_v2", "8nkj8rm7") - end - - VCR.use_cassette("AMEE_Connection_Caching_Off/authenticating") do - @connection.authenticate - end - - VCR.use_cassette("AMEE_Connection_Caching_Off/first_request") do - @first_response = AMEE::Data::Category.get(@connection, '/data/home/energy/quantity') - end - - VCR.use_cassette("AMEE_Connection_Caching_Off/second_request") do - @second_response = AMEE::Data::Category.get(@connection, '/data/home/energy/quantity') - end - - # We're checking to see if we actually have a returned object. - # If there's no response in the VCR cassette, then we can't build the object - # to check if it responds to the methods below - @first_response.should respond_to(:uid) - @first_response.should respond_to(:name) - - # Likewise with the second response. There needs to be a yaml file to read from to - # build the object. - File.exists?('cassettes/AMEE_Connection_Caching_Off/second_request.yml').should be true - # Then we check for the same content to see we can build the object needed. - @second_response.should respond_to(:uid) - @second_response.should respond_to(:name) - - end - - end - - describe 'with caching' do - - def setup_connection - VCR.use_cassette("AMEE_Connection_Caching_On/logging_in") do - @connection = AMEE::Connection.new("stage.amee.com", "amee_ruby_vcr_v2", "8nkj8rm7", :cache => :memory_store) - end - - VCR.use_cassette("AMEE_Connection_Caching_On/authenticating") do - @connection.authenticate - end - - VCR.use_cassette("AMEE_Connection_Caching_On/first_request") do - @first_response = AMEE::Data::Category.get(@connection, '/data/home/energy/quantity') - end - end - - it "caches GET requests" do - - setup_connection - - VCR.use_cassette("AMEE_Connection_Caching_On/second_request") do - @second_response = AMEE::Data::Category.get(@connection, '/data/home/energy/quantity') - end - - # We're checking to see if we actually have a returned object. - # If there's no response in the VCR cassette, then we can't build the object - # to check if it responds to the methods below - @first_response.should respond_to(:uid) - @first_response.should respond_to(:name) - - # Likewise with the second response. When caching is on, we don't want to see a second - # request being recorded, but we still want to see the object being built - File.exists?('cassettes/AMEE_Connection_Caching_On/second_request.yml').should be false - # Then we check for the same content to see we can build the object needed. - @second_response.should respond_to(:uid) - @second_response.should respond_to(:name) - end - - it "allows complete cache clear" do - - setup_connection - @connection.expire_all - - VCR.use_cassette("AMEE_Connection_Caching_clear_all/second_request") do - @second_response = AMEE::Data::Category.get(@connection, '/data/home/energy/quantity') - end - - File.exists?('cassettes/AMEE_Connection_Caching_clear_all/second_request.yml').should be true - @second_response.should respond_to(:uid) - @second_response.should respond_to(:name) - end - - it "allows manual cache expiry for objects" do - setup_connection - @first_response.expire_cache - - VCR.use_cassette("AMEE_Connection_Caching_clear_manually/second_request") do - @second_response = AMEE::Data::Category.get(@connection, '/data/home/energy/quantity') - end - - File.exists?('cassettes/AMEE_Connection_Caching_clear_manually/second_request.yml').should be true - @second_response.should respond_to(:uid) - @second_response.should respond_to(:name) - end - - it "object expiry invalidates objects further down the tree" do - setup_connection - - VCR.use_cassette("AMEE_Connection_Caching_further_down_tree/second_request") do - @second_response = @first_response.item :label => 'biodiesel' - @first_response.expire_cache - @third_response = @first_response.item :label => 'biodiesel' - end - - File.exists?('cassettes/AMEE_Connection_Caching_further_down_tree/second_request.yml').should be true - @second_response.label.should == "biodiesel" - @third_response.label.should == "biodiesel" - - end - - it "removes special characters from cache keys, include slashes" do - setup_connection - @connection.send(:cache_key, "/%cache/$4/%20test").should eql 'stage.amee.com_cache_4_20test' - end - - it "works around rails 3 file store cache key bug by disallowing cache keys with length 229/230" do - setup_connection - cache = ActiveSupport::Cache.lookup_store(:file_store, '/tmp/amee-ruby-cache-test') - # test caching of lots of key lengths - (200..500).each do |i| - # Generate cache key - test_str = 'a' * i - key = @connection.send(:cache_key, test_str) - lambda { cache.write(key, {}) }.should_not raise_error - cache.delete(key) - end - end - - - describe 'and automatic invalidation' do - - def test_invalidation_sequence(interactions) - setup_connection - flexmock(@connection) do |mock| - interactions.each do |path, action, result| - mock.should_receive(:run_request).once.and_return(OpenStruct.new(:code => '200', :body => path)) if result - end - end - interactions.each do |path, action, result| - if action - @connection.send(action, path).body.should == path - end - end - end - - it "handles PUT requests" do - VCR.use_cassette("AMEE_Connection_Caching/automatic_invalidation_for_put") do - test_invalidation_sequence([ - # Fill the cache - ["/parent/object", :get, true], - ["/parent", :get, true], - ["/parent/object/child", :get, true], - ["/parent/sibling", :get, true], - ["/uncle/cousin", :get, true], - ["/uncle", :get, true], - # Do a PUT - ["/parent/object", :put, true], - # Check that cache is cleared in the right places - ["/parent/object", :get, true], - ["/parent", :get, true], - ["/parent/object/child", :get, true], - ["/parent/sibling", :get, true], - ["/uncle/cousin", :get, false], - ["/uncle", :get, false], - ]) - end - end - - it "handles POST requests" do - VCR.use_cassette("AMEE_Connection_Caching/automatic_invalidation_for_post") do - test_invalidation_sequence([ - # Fill the cache - ["/parent/object", :get, true], - ["/parent", :get, true], - ["/parent/object/child", :get, true], - ["/parent/sibling", :get, true], - ["/uncle/cousin", :get, true], - ["/uncle", :get, true], - # Do a POST - ["/parent/object", :post, true], - # Check that cache is cleared in the right places - ["/parent/object", :get, true], - ["/parent", :get, false], - ["/parent/object/child", :get, true], - ["/parent/sibling", :get, false], - ["/uncle/cousin", :get, false], - ["/uncle", :get, false], - ]) - end - end - - it "handles DELETE requests" do - VCR.use_cassette("AMEE_Connection_Caching/automatic_invalidation_for_delete") do - test_invalidation_sequence([ - # Fill the cache - ["/parent/object", :get, true], - ["/parent", :get, true], - ["/parent/object/child", :get, true], - ["/parent/sibling", :get, true], - ["/uncle/cousin", :get, true], - ["/uncle", :get, true], - # Do a DELETE - ["/parent/object", :delete, true], - # Check that cache is cleared in the right places - ["/parent/object", :get, true], - ["/parent", :get, true], - ["/parent/object/child", :get, true], - ["/parent/sibling", :get, true], - ["/uncle/cousin", :get, false], - ["/uncle", :get, false], - ]) - end - end - - end - - end - -end diff --git a/spec/connection_spec.rb b/spec/connection_spec.rb index c4ecf09..29b4a9d 100644 --- a/spec/connection_spec.rb +++ b/spec/connection_spec.rb @@ -39,8 +39,7 @@ describe AMEE::Connection, "with authentication" do - describe "using a version 1 api key" do - use_vcr_cassette "AMEE_Connection_with_authentication/using a v1 key", :record => :new_episodes + describe "using a version 1 api key", {:vcr => {:cassette_name => "AMEE_Connection_with_authentication/using a v1 key"}} do it "detects the API version (1)" do amee = AMEE::Connection.new('stage.amee.com', AMEE_V1_API_KEY, AMEE_V1_PASSWORD) amee.authenticate @@ -50,35 +49,31 @@ end describe "using a version 2 api key" do - - it "should start out unauthenticated" do - amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) - amee.authenticated?.should be_false - end - - it "detects the API version (2 - XML) normally" do - VCR.use_cassette('AMEE_Connection_with_authentication/using_a_v2_key/detects the API version for XML') do + it "should start out unauthenticated" do amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) - amee.authenticate - amee.authenticated?.should be_true - amee.version.should == 2.0 + amee.authenticated?.should be_false end - end - it "detects the API version (2 - JSON)" do - VCR.use_cassette('AMEE_Connection_with_authentication/using_a_v2_key/detects the API version for JSON') do - amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) - amee.authenticate - amee.authenticated?.should be_true - amee.version.should == 2.0 + it "detects the API version (2 - XML) normally" do + VCR.use_cassette('AMEE_Connection_with_authentication/using_a_v2_key/detects the API version for XML') do + amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) + amee.authenticate + amee.authenticated?.should be_true + amee.version.should == 2.0 + end end - end + it "detects the API version (2 - JSON)" do + VCR.use_cassette('AMEE_Connection_with_authentication/using_a_v2_key/detects the API version for JSON') do + amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) + amee.authenticate + amee.authenticated?.should be_true + amee.version.should == 2.0 + end + end end - describe "hitting_private_urls" do - use_vcr_cassette - + describe "hitting_private_urls", :vcr => {:cassette_name => 'AMEE_Connection_with_authentication/hitting_private_urls'} do it "should be able to get private URLs" do amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) amee.get('/data') do |response| @@ -88,17 +83,14 @@ end end - describe "handling 404s" do - use_vcr_cassette + describe "handling 404s", :vcr => true do it "should handle 404s gracefully" do amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) lambda{amee.get('/missing_url')}.should raise_error(AMEE::NotFound, "The URL was not found on the server.\nRequest: GET /missing_url") end end - describe "raising errors if permission denied" do - use_vcr_cassette - + describe "raising errors if permission denied", :vcr => true do it "should raise error if permission for operation is denied" do amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) lambda { @@ -150,8 +142,7 @@ end -describe AMEE::Connection, "with retry enabled" do - use_vcr_cassette +describe AMEE::Connection, "with retry enabled", :vcr => true do [ AMEE::TimeOut, ].each do |e| @@ -238,9 +229,7 @@ end -describe AMEE::Connection, "with incorrect server name" do - - use_vcr_cassette +describe AMEE::Connection, "with incorrect server name", :vcr => true do it "should raise a useful error" do amee = AMEE::Connection.new('badservername.example.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) lambda{ @@ -252,8 +241,7 @@ describe AMEE::Connection, "with bad authentication information" do - describe "hitting a private url" do - use_vcr_cassette + describe "hitting a private url", :vcr => true do it "should get an authentication failure" do amee = AMEE::Connection.new('stage.amee.com', 'wrong', 'details') lambda{ @@ -265,8 +253,7 @@ # according to the docs, public urls should not be accessible without # an api key either # http://www.amee.com/developer/docs/apc.php#auth-reference - describe "hitting a public url" do - use_vcr_cassette + describe "hitting a public url", :vcr => true do it "should not be capable of making requests for public URLs" do amee = AMEE::Connection.new('stage.amee.com', 'wrong', 'details') lambda{ @@ -279,8 +266,7 @@ end -describe AMEE::Connection, "with authentication , doing write-requests" do - use_vcr_cassette +describe AMEE::Connection, "with authentication , doing write-requests", :vcr => true do it "should be able to send post requests" do amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) amee.post('/profiles', {:profile => true}) do |response| @@ -290,8 +276,7 @@ describe "working with an existing profile" do - describe "sending updates to existing items" do - use_vcr_cassette + describe "sending updates to existing items", :vcr => true do it "should be possible" do amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) @@ -312,8 +297,7 @@ end end - describe "deleting existing items" do - use_vcr_cassette + describe "deleting existing items", :vcr => true do it "should also be possible" do amee = AMEE::Connection.new('stage.amee.com', AMEE_V2_API_KEY, AMEE_V2_PASSWORD) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 015d9d3..7b8c296 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,6 +11,9 @@ $:.unshift(File.dirname(__FILE__) + '/../lib') require 'amee' +WebMock.enable! +WebMock.disable_net_connect! + def test_credentials(filename) test_creds = File.read File.dirname(__FILE__)+'/../'+filename YAML.load(test_creds) @@ -24,8 +27,9 @@ def test_credentials(filename) AMEE_V3_PASSWORD = test_credentials('amee_test_credentials.yml')['v3']['password'] -VCR.config do |c| - c.stub_with :webmock +VCR.configure do |c| + c.configure_rspec_metadata! + c.hook_into :webmock c.default_cassette_options = { :record => :once } c.cassette_library_dir = 'cassettes' c.filter_sensitive_data('') { AMEE_V1_API_KEY} @@ -38,7 +42,6 @@ def test_credentials(filename) RSpec.configure do |config| config.mock_with :flexmock - config.extend VCR::RSpec::Macros end # Stub activerecord for rails tests diff --git a/spec/v3/connection_spec.rb b/spec/v3/connection_spec.rb index 7cc18da..a67877f 100644 --- a/spec/v3/connection_spec.rb +++ b/spec/v3/connection_spec.rb @@ -10,9 +10,9 @@ end it "should have a connection to meta server" do - VCR.use_cassette("AMEE_Connection/v3/should have a connection to meta server") do + VCR.use_cassette("AMEE_Connection/v3/should have a connection to meta server") do @c.authenticate.should_not be_nil - end + end end it "should login and know the path to the server" do @@ -49,31 +49,10 @@ }.should raise_error end - it "should generate correct hostname for platform-dev.amee.com" do - c = AMEE::Connection.new('platform-dev.amee.com', 'username', 'password') - c.send(:v3_hostname).should eql 'platform-api-dev.amee.com' - end - - it "should generate correct hostname for platform-science.amee.com" do - c = AMEE::Connection.new('platform-science.amee.com', 'username', 'password') - c.send(:v3_hostname).should eql 'platform-api-science.amee.com' - end - - it "should generate correct hostname for stage.amee.com" do - c = AMEE::Connection.new('stage.amee.com', 'username', 'password') - c.send(:v3_hostname).should eql 'platform-api-stage.amee.com' - end - - it "should generate correct hostname for live.amee.com" do - c = AMEE::Connection.new('live.amee.com', 'username', 'password') - c.send(:v3_hostname).should eql 'platform-api-live.amee.com' - end - it "should not change modern hostnames" do c = AMEE::Connection.new('platform-api-test.amee.com', 'username', 'password') c.send(:v3_hostname).should eql 'platform-api-test.amee.com' end - end describe AMEE::Connection, "with retry enabled" do @@ -178,4 +157,4 @@ end end -end \ No newline at end of file +end