From 7533238ef5249fd083bbf0c57d2b1b0c314480a8 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 15:26:47 -0700 Subject: [PATCH 01/46] some bundling ad yak shaving --- .gitignore | 4 ++++ Gemfile | 27 +++------------------------ Gemfile.lock | 42 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 03f3ce7..3368974 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' +/config/secrets.yml + # Ignore bundler config. /.bundle @@ -63,3 +65,5 @@ build-iPhoneSimulator/ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc + + diff --git a/Gemfile b/Gemfile index 288bb87..2804bb2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,45 +1,24 @@ source 'https://rubygems.org' ruby '2.3.1' -# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.6' -# Use postgresql as the database for Active Record gem 'pg', '~> 0.15' -# Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' -# Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' -# Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.1.0' -# See https://github.com/rails/execjs#readme for more supported runtimes -# gem 'therubyracer', platforms: :ruby - -# Use jquery as the JavaScript library gem 'jquery-rails' -# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.0' -# bundle exec rake doc:rails generates the API under doc/api. +gem 'httparty' +gem 'rspotify' +gem 'yelp' gem 'sdoc', '~> 0.4.0', group: :doc -# Use ActiveModel has_secure_password -# gem 'bcrypt', '~> 3.1.7' - -# Use Unicorn as the app server -# gem 'unicorn' - -# Use Capistrano for deployment -# gem 'capistrano-rails', group: :development - group :development, :test do - # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug' end group :development do - # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '~> 2.0' - - # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' end diff --git a/Gemfile.lock b/Gemfile.lock index 6ff0f39..6d371df 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -52,8 +52,16 @@ GEM debug_inspector (0.0.2) erubis (2.7.0) execjs (2.6.0) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + faraday_middleware (0.10.0) + faraday (>= 0.7.4, < 0.10) globalid (0.3.6) activesupport (>= 4.1.0) + hashie (3.4.4) + httparty (0.13.7) + json (~> 1.8) + multi_xml (>= 0.5.2) i18n (0.7.0) jbuilder (2.4.1) activesupport (>= 3.0.0, < 5.1) @@ -63,6 +71,7 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.3) + jwt (1.5.1) loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.4) @@ -73,8 +82,23 @@ GEM mini_portile2 (2.0.0) minitest (5.8.4) multi_json (1.12.0) + multi_xml (0.5.5) + multipart-post (2.0.0) + netrc (0.7.9) nokogiri (1.6.7.2) mini_portile2 (~> 2.0.0.rc2) + oauth2 (1.1.0) + faraday (>= 0.8, < 0.10) + jwt (~> 1.0, < 1.5.2) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (>= 1.2, < 3) + omniauth (1.3.1) + hashie (>= 1.2, < 4) + rack (>= 1.0, < 3) + omniauth-oauth2 (1.4.0) + oauth2 (~> 1.0) + omniauth (~> 1.2) pg (0.18.4) rack (1.6.4) rack-test (0.6.3) @@ -106,6 +130,11 @@ GEM rake (11.1.2) rdoc (4.2.2) json (~> 1.4) + rest_client (1.8.3) + netrc (~> 0.7.7) + rspotify (1.10.0) + omniauth-oauth2 (~> 1.1) + rest_client (~> 1.8) sass (3.4.22) sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) @@ -116,6 +145,7 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) + simple_oauth (0.3.1) spring (1.7.1) sprockets (3.6.0) concurrent-ruby (~> 1.0) @@ -136,6 +166,10 @@ GEM binding_of_caller (>= 0.7.2) railties (>= 4.0) sprockets-rails (>= 2.0, < 4.0) + yelp (2.1.2) + faraday (~> 0.8, >= 0.8.0) + faraday_middleware (~> 0.8, >= 0.8.0) + simple_oauth (~> 0.3.1) PLATFORMS ruby @@ -143,15 +177,21 @@ PLATFORMS DEPENDENCIES byebug coffee-rails (~> 4.1.0) + httparty jbuilder (~> 2.0) jquery-rails pg (~> 0.15) rails (= 4.2.6) + rspotify sass-rails (~> 5.0) sdoc (~> 0.4.0) spring uglifier (>= 1.3.0) web-console (~> 2.0) + yelp + +RUBY VERSION + ruby 2.3.1p112 BUNDLED WITH - 1.12.3 + 1.12.4 From 32acc60c9ffcb03ba3d983f68918dfe0f03a540e Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 15:28:51 -0700 Subject: [PATCH 02/46] and more changes to gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3368974..1725506 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' -/config/secrets.yml +config/secrets.yml # Ignore bundler config. /.bundle From f34fa9dbedeff715c7e06cd28ddef2cd72d50841 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 15:41:10 -0700 Subject: [PATCH 03/46] testing secrets --- app/assets/javascripts/sessions.coffee | 3 +++ app/assets/javascripts/suggestions.coffee | 3 +++ app/assets/stylesheets/sessions.scss | 3 +++ app/assets/stylesheets/suggestions.scss | 3 +++ app/controllers/sessions_controller.rb | 2 ++ app/controllers/suggestions_controller.rb | 2 ++ app/helpers/sessions_helper.rb | 2 ++ app/helpers/suggestions_helper.rb | 2 ++ app/models/food.rb | 2 ++ app/models/music.rb | 2 ++ app/models/user.rb | 3 +++ config/secrets.yml | 3 +++ db/migrate/20160516223253_create_users.rb | 8 ++++++++ db/migrate/20160516223304_create_foods.rb | 8 ++++++++ db/migrate/20160516223310_create_musics.rb | 8 ++++++++ test/controllers/sessions_controller_test.rb | 7 +++++++ test/controllers/suggestions_controller_test.rb | 7 +++++++ test/fixtures/foods.yml | 11 +++++++++++ test/fixtures/musics.yml | 11 +++++++++++ test/fixtures/users.yml | 11 +++++++++++ test/models/food_test.rb | 7 +++++++ test/models/music_test.rb | 7 +++++++ test/models/user_test.rb | 7 +++++++ 23 files changed, 122 insertions(+) create mode 100644 app/assets/javascripts/sessions.coffee create mode 100644 app/assets/javascripts/suggestions.coffee create mode 100644 app/assets/stylesheets/sessions.scss create mode 100644 app/assets/stylesheets/suggestions.scss create mode 100644 app/controllers/sessions_controller.rb create mode 100644 app/controllers/suggestions_controller.rb create mode 100644 app/helpers/sessions_helper.rb create mode 100644 app/helpers/suggestions_helper.rb create mode 100644 app/models/food.rb create mode 100644 app/models/music.rb create mode 100644 app/models/user.rb create mode 100644 db/migrate/20160516223253_create_users.rb create mode 100644 db/migrate/20160516223304_create_foods.rb create mode 100644 db/migrate/20160516223310_create_musics.rb create mode 100644 test/controllers/sessions_controller_test.rb create mode 100644 test/controllers/suggestions_controller_test.rb create mode 100644 test/fixtures/foods.yml create mode 100644 test/fixtures/musics.yml create mode 100644 test/fixtures/users.yml create mode 100644 test/models/food_test.rb create mode 100644 test/models/music_test.rb create mode 100644 test/models/user_test.rb diff --git a/app/assets/javascripts/sessions.coffee b/app/assets/javascripts/sessions.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/sessions.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/suggestions.coffee b/app/assets/javascripts/suggestions.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/suggestions.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/sessions.scss b/app/assets/stylesheets/sessions.scss new file mode 100644 index 0000000..7bef9cf --- /dev/null +++ b/app/assets/stylesheets/sessions.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the sessions controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/suggestions.scss b/app/assets/stylesheets/suggestions.scss new file mode 100644 index 0000000..c0d3b8d --- /dev/null +++ b/app/assets/stylesheets/suggestions.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the suggestions controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 0000000..16d11b5 --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,2 @@ +class SessionsController < ApplicationController +end diff --git a/app/controllers/suggestions_controller.rb b/app/controllers/suggestions_controller.rb new file mode 100644 index 0000000..d5b0599 --- /dev/null +++ b/app/controllers/suggestions_controller.rb @@ -0,0 +1,2 @@ +class SuggestionsController < ApplicationController +end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb new file mode 100644 index 0000000..309f8b2 --- /dev/null +++ b/app/helpers/sessions_helper.rb @@ -0,0 +1,2 @@ +module SessionsHelper +end diff --git a/app/helpers/suggestions_helper.rb b/app/helpers/suggestions_helper.rb new file mode 100644 index 0000000..0e358dd --- /dev/null +++ b/app/helpers/suggestions_helper.rb @@ -0,0 +1,2 @@ +module SuggestionsHelper +end diff --git a/app/models/food.rb b/app/models/food.rb new file mode 100644 index 0000000..3f58467 --- /dev/null +++ b/app/models/food.rb @@ -0,0 +1,2 @@ +class Food < ActiveRecord::Base +end diff --git a/app/models/music.rb b/app/models/music.rb new file mode 100644 index 0000000..427c9c2 --- /dev/null +++ b/app/models/music.rb @@ -0,0 +1,2 @@ +class Music < ActiveRecord::Base +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000..110d9e3 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,3 @@ +class User < ActiveRecord::Base + validates :provider, presence: true, +end diff --git a/config/secrets.yml b/config/secrets.yml index be83593..55992c0 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -20,3 +20,6 @@ test: # instead read values from the environment. production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> + +development: + secret_key_base: 9999ajajaj9 \ No newline at end of file diff --git a/db/migrate/20160516223253_create_users.rb b/db/migrate/20160516223253_create_users.rb new file mode 100644 index 0000000..e6f0ee5 --- /dev/null +++ b/db/migrate/20160516223253_create_users.rb @@ -0,0 +1,8 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20160516223304_create_foods.rb b/db/migrate/20160516223304_create_foods.rb new file mode 100644 index 0000000..5d62fcd --- /dev/null +++ b/db/migrate/20160516223304_create_foods.rb @@ -0,0 +1,8 @@ +class CreateFoods < ActiveRecord::Migration + def change + create_table :foods do |t| + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20160516223310_create_musics.rb b/db/migrate/20160516223310_create_musics.rb new file mode 100644 index 0000000..2cc03f3 --- /dev/null +++ b/db/migrate/20160516223310_create_musics.rb @@ -0,0 +1,8 @@ +class CreateMusics < ActiveRecord::Migration + def change + create_table :musics do |t| + + t.timestamps null: false + end + end +end diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb new file mode 100644 index 0000000..d30ebc3 --- /dev/null +++ b/test/controllers/sessions_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SessionsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/suggestions_controller_test.rb b/test/controllers/suggestions_controller_test.rb new file mode 100644 index 0000000..f4587a5 --- /dev/null +++ b/test/controllers/suggestions_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SuggestionsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/fixtures/foods.yml b/test/fixtures/foods.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/foods.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/musics.yml b/test/fixtures/musics.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/musics.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 0000000..937a0c0 --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/food_test.rb b/test/models/food_test.rb new file mode 100644 index 0000000..8ad7dff --- /dev/null +++ b/test/models/food_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class FoodTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/music_test.rb b/test/models/music_test.rb new file mode 100644 index 0000000..c5c6737 --- /dev/null +++ b/test/models/music_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MusicTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000..82f61e0 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From c5dc09e8742ce69260cf9c694241e4ed5b60802e Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 15:41:39 -0700 Subject: [PATCH 04/46] testing secrets --- .gitignore | 2 +- config/secrets.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1725506..4fb5276 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' -config/secrets.yml +./config/secrets.yml # Ignore bundler config. /.bundle diff --git a/config/secrets.yml b/config/secrets.yml index 55992c0..3477304 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -22,4 +22,4 @@ production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> development: - secret_key_base: 9999ajajaj9 \ No newline at end of file + secret_key_base: 9999ajajaj9858585 \ No newline at end of file From c11b3c0a0f349b124f17cb62ff83539562b66e9d Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 16:16:23 -0700 Subject: [PATCH 05/46] removing secrets --- Gemfile | 1 + Gemfile.lock | 7 +++++++ app/models/user.rb | 9 +++++++-- config/secrets.yml | 3 --- db/migrate/20160516223253_create_users.rb | 1 - 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 2804bb2..7c08504 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,7 @@ gem 'jbuilder', '~> 2.0' gem 'httparty' gem 'rspotify' gem 'yelp' +gem 'simplecov' gem 'sdoc', '~> 0.4.0', group: :doc group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index 6d371df..7ee0aee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,6 +50,7 @@ GEM coffee-script-source (1.10.0) concurrent-ruby (1.0.2) debug_inspector (0.0.2) + docile (1.1.5) erubis (2.7.0) execjs (2.6.0) faraday (0.9.2) @@ -146,6 +147,11 @@ GEM json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) simple_oauth (0.3.1) + simplecov (0.11.2) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) spring (1.7.1) sprockets (3.6.0) concurrent-ruby (~> 1.0) @@ -185,6 +191,7 @@ DEPENDENCIES rspotify sass-rails (~> 5.0) sdoc (~> 0.4.0) + simplecov spring uglifier (>= 1.3.0) web-console (~> 2.0) diff --git a/app/models/user.rb b/app/models/user.rb index 110d9e3..3d16716 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,3 +1,8 @@ -class User < ActiveRecord::Base - validates :provider, presence: true, +class User + include ActiveModel::Validations + + attr_reader :provider, :uid, :name + + validates :provider, presence: true + validates :uid, presence: true end diff --git a/config/secrets.yml b/config/secrets.yml index 3477304..be83593 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -20,6 +20,3 @@ test: # instead read values from the environment. production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> - -development: - secret_key_base: 9999ajajaj9858585 \ No newline at end of file diff --git a/db/migrate/20160516223253_create_users.rb b/db/migrate/20160516223253_create_users.rb index e6f0ee5..3c551b3 100644 --- a/db/migrate/20160516223253_create_users.rb +++ b/db/migrate/20160516223253_create_users.rb @@ -1,7 +1,6 @@ class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| - t.timestamps null: false end end From b3398971e56c21fd31caeac026a8957b4ccd1802 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 16:19:20 -0700 Subject: [PATCH 06/46] secrets --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4fb5276..9a5457f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' -./config/secrets.yml # Ignore bundler config. /.bundle From e59903393540c351cfe732bab2d16963c8f1f9b6 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 16:20:36 -0700 Subject: [PATCH 07/46] what am i doing --- .gitignore | 1 + config/secrets.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9a5457f..4fb5276 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' +./config/secrets.yml # Ignore bundler config. /.bundle diff --git a/config/secrets.yml b/config/secrets.yml index be83593..b0f8211 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -19,4 +19,4 @@ test: # Do not keep production secrets in the repository, # instead read values from the environment. production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> \ No newline at end of file From 461edb774c13786767627f55e55bb81c5a5245de Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 16:21:54 -0700 Subject: [PATCH 08/46] gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4fb5276..3368974 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' -./config/secrets.yml +/config/secrets.yml # Ignore bundler config. /.bundle From 40ee04eebb17ae67a9e6df2282930dee18ae0a5f Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 16:23:05 -0700 Subject: [PATCH 09/46] everything --- .gitignore | 3 +++ config/secrets.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3368974..779ca7e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ # git config --global core.excludesfile '~/.gitignore_global' /config/secrets.yml +secrets.yml +config/secrets.yml +./config/secrets.yml # Ignore bundler config. /.bundle diff --git a/config/secrets.yml b/config/secrets.yml index b0f8211..be83593 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -19,4 +19,4 @@ test: # Do not keep production secrets in the repository, # instead read values from the environment. production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> \ No newline at end of file + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> From 057394efba224b1adc14d78e276cb28d9a5a988a Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 16:23:47 -0700 Subject: [PATCH 10/46] testing again --- config/secrets.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/secrets.yml b/config/secrets.yml index be83593..4709dcd 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -20,3 +20,5 @@ test: # instead read values from the environment. production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> + + kdjksj \ No newline at end of file From 36d229831a34254ea38129daf5fe6caac86d9d15 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 16:26:58 -0700 Subject: [PATCH 11/46] secrets file from now on, is now hidden --- .gitignore | 4 +--- config/secrets.yml | 24 ------------------------ 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 config/secrets.yml diff --git a/.gitignore b/.gitignore index 779ca7e..e255d35 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,7 @@ # git config --global core.excludesfile '~/.gitignore_global' /config/secrets.yml -secrets.yml -config/secrets.yml -./config/secrets.yml + # Ignore bundler config. /.bundle diff --git a/config/secrets.yml b/config/secrets.yml deleted file mode 100644 index 4709dcd..0000000 --- a/config/secrets.yml +++ /dev/null @@ -1,24 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -development: - secret_key_base: 553149b03d6ba63414be540733245f323d241c1c9a37f3266d1216d93effd901fefb43f0782e4d2b739d61a3de1488c681a90435b22318114f638d9fc6e0f8c1 - -test: - secret_key_base: 0c9e2ff02abb06b715fccfbd8a7fb390a12595cf1c4d8b58cae707903a17a4a58ea0762f4a2125da40cf59b211620b81e702e13d58c4a50e4591f48dcbf1cbaa - -# Do not keep production secrets in the repository, -# instead read values from the environment. -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> - - kdjksj \ No newline at end of file From 4adf0be861ecd0617c29b4349629b40e9a34305d Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 16 May 2016 16:49:51 -0700 Subject: [PATCH 12/46] env gem --- .gitignore | 5 +---- Gemfile | 1 + Gemfile.lock | 5 +++++ config/secrets.yml | 9 +++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 config/secrets.yml diff --git a/.gitignore b/.gitignore index e255d35..b380018 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,6 @@ # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' -/config/secrets.yml - - # Ignore bundler config. /.bundle @@ -29,7 +26,7 @@ /tmp/ # Used by dotenv library to load environment variables. -# .env +.env ## Specific to RubyMotion: .dat* diff --git a/Gemfile b/Gemfile index 7c08504..1b79735 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,7 @@ gem 'sdoc', '~> 0.4.0', group: :doc group :development, :test do gem 'byebug' + gem 'dotenv-rails' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 7ee0aee..d8e17de 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,6 +51,10 @@ GEM concurrent-ruby (1.0.2) debug_inspector (0.0.2) docile (1.1.5) + dotenv (2.1.1) + dotenv-rails (2.1.1) + dotenv (= 2.1.1) + railties (>= 4.0, < 5.1) erubis (2.7.0) execjs (2.6.0) faraday (0.9.2) @@ -183,6 +187,7 @@ PLATFORMS DEPENDENCIES byebug coffee-rails (~> 4.1.0) + dotenv-rails httparty jbuilder (~> 2.0) jquery-rails diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000..229e86d --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,9 @@ + +development: + secret_key_base: 553149b03d6ba63414be540733245f323d241c1c9a37f3266d1216d93effd901fefb43f0782e4d2b739d61a3de1488c681a90435b22318114f638d9fc6e0f8c1 + +test: + secret_key_base: 0c9e2ff02abb06b715fccfbd8a7fb390a12595cf1c4d8b58cae707903a17a4a58ea0762f4a2125da40cf59b211620b81e702e13d58c4a50e4591f48dcbf1cbaa + +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> From ce85f877fdf3d33c6ac56b20b4c8b17d1c38da91 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 17 May 2016 08:59:59 -0700 Subject: [PATCH 13/46] yelp config file --- config/initializers/omniauth.rb | 0 config/initializers/yelp.rb | 8 ++++++++ 2 files changed, 8 insertions(+) create mode 100644 config/initializers/omniauth.rb create mode 100644 config/initializers/yelp.rb diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb new file mode 100644 index 0000000..e69de29 diff --git a/config/initializers/yelp.rb b/config/initializers/yelp.rb new file mode 100644 index 0000000..87910e5 --- /dev/null +++ b/config/initializers/yelp.rb @@ -0,0 +1,8 @@ +require 'yelp' + +Yelp.client.configure do |config| + config.consumer_key = YELP_CONSUMER_KEY + config.consumer_secret = YELP_CONSUMER_SECRET + config.token = YELP_TOKEN + config.token_secret = YELP_TOKEN_SECRET +end \ No newline at end of file From d2ece66aeeab66b3f531160029be608f63e1aa66 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 17 May 2016 09:03:20 -0700 Subject: [PATCH 14/46] omniauth file --- config/initializers/omniauth.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index e69de29..b526b23 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -0,0 +1,5 @@ +require 'rspotify/oauth' + +Rails.application.config.middleware.use OmniAuth::Builder do + provider :spotify, "SPOTIFY_CLIENT_ID", "SPOTIFY_CLIENT_SECRET", scope: 'user-read-email playlist-modify-public user-library-read user-library-modify' +end \ No newline at end of file From 6335662d77d5d0531eb0406b05fe19b259215b7e Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 17 May 2016 11:39:56 -0700 Subject: [PATCH 15/46] starting to work on music model but i don't know what's going on yet. have a view for suggestions and it works. --- app/controllers/suggestions_controller.rb | 3 ++ app/models/music.rb | 27 ++++++++++- app/models/user.rb | 6 +-- app/views/layouts/application.html.erb | 2 +- app/views/suggestions/index.html.erb | 1 + config/initializers/omniauth.rb | 8 ++-- config/initializers/spotify.rb | 3 ++ config/initializers/yelp.rb | 8 ++-- config/routes.rb | 56 +---------------------- db/migrate/20160516223253_create_users.rb | 3 ++ db/schema.rb | 34 ++++++++++++++ 11 files changed, 82 insertions(+), 69 deletions(-) create mode 100644 app/views/suggestions/index.html.erb create mode 100644 config/initializers/spotify.rb create mode 100644 db/schema.rb diff --git a/app/controllers/suggestions_controller.rb b/app/controllers/suggestions_controller.rb index d5b0599..30719cb 100644 --- a/app/controllers/suggestions_controller.rb +++ b/app/controllers/suggestions_controller.rb @@ -1,2 +1,5 @@ class SuggestionsController < ApplicationController + def index + + end end diff --git a/app/models/music.rb b/app/models/music.rb index 427c9c2..e0d917d 100644 --- a/app/models/music.rb +++ b/app/models/music.rb @@ -1,2 +1,27 @@ -class Music < ActiveRecord::Base +require 'httparty' + +class Music + + BASE_URL = "https://tunes-takeout-api.herokuapp.com/v1/" + + # attr_reader :name, :moves, :sprites + + def initialize(data) + # @name = data["name"] + # @moves = data["moves"] + # @sprites = reject_null_sprites(data["sprites"]) + end + + def self.find(id) + data = HTTParty.get(BASE_URL + "suggestions/search/#{id}").parsed_response + self.new(data) + end + + # private + + # def reject_null_sprites(sprite_hash) + # sprite_hash.reject do |name, url| + # url.nil? + # end + end diff --git a/app/models/user.rb b/app/models/user.rb index 3d16716..8a24969 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,8 +1,4 @@ -class User - include ActiveModel::Validations - - attr_reader :provider, :uid, :name - +class User < ActiveRecord::Base validates :provider, presence: true validates :uid, presence: true end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 509d1a2..4b5582f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - TunesTakeout + food tunes <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag 'application' %> <%= csrf_meta_tags %> diff --git a/app/views/suggestions/index.html.erb b/app/views/suggestions/index.html.erb new file mode 100644 index 0000000..ffd60bc --- /dev/null +++ b/app/views/suggestions/index.html.erb @@ -0,0 +1 @@ +

Something is working

\ No newline at end of file diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index b526b23..d2ef91f 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,5 +1,5 @@ -require 'rspotify/oauth' +# require 'rspotify/oauth' -Rails.application.config.middleware.use OmniAuth::Builder do - provider :spotify, "SPOTIFY_CLIENT_ID", "SPOTIFY_CLIENT_SECRET", scope: 'user-read-email playlist-modify-public user-library-read user-library-modify' -end \ No newline at end of file +# Rails.application.config.middleware.use OmniAuth::Builder do +# provider :spotify, "SPOTIFY_CLIENT_ID", "SPOTIFY_CLIENT_SECRET", scope: 'user-read-email playlist-modify-public user-library-read user-library-modify' +# end \ No newline at end of file diff --git a/config/initializers/spotify.rb b/config/initializers/spotify.rb new file mode 100644 index 0000000..1ebaa89 --- /dev/null +++ b/config/initializers/spotify.rb @@ -0,0 +1,3 @@ +require 'rspotify' + +RSpotify::authenticate(ENV["SPOTIFY_CLIENT_ID"], ENV["SPOTIFY_CLIENT_SECRET"]) \ No newline at end of file diff --git a/config/initializers/yelp.rb b/config/initializers/yelp.rb index 87910e5..c9b2e18 100644 --- a/config/initializers/yelp.rb +++ b/config/initializers/yelp.rb @@ -1,8 +1,8 @@ require 'yelp' Yelp.client.configure do |config| - config.consumer_key = YELP_CONSUMER_KEY - config.consumer_secret = YELP_CONSUMER_SECRET - config.token = YELP_TOKEN - config.token_secret = YELP_TOKEN_SECRET + config.consumer_key = ENV["YELP_CONSUMER_KEY"] + config.consumer_secret = ENV["YELP_CONSUMER_SECRET"] + config.token = ENV["YELP_TOKEN"] + config.token_secret = ENV["YELP_TOKEN_SECRET"] end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3f66539..d4ce000 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,56 +1,4 @@ Rails.application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end + + root "suggestions#index" end diff --git a/db/migrate/20160516223253_create_users.rb b/db/migrate/20160516223253_create_users.rb index 3c551b3..c2cdbc5 100644 --- a/db/migrate/20160516223253_create_users.rb +++ b/db/migrate/20160516223253_create_users.rb @@ -1,6 +1,9 @@ class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| + t.string :provider, null: false + t.string :uid, null: false + t.string :name t.timestamps null: false end end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..5c2a66a --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,34 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20160516223310) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "foods", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "musics", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "users", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end From 1c76eb2efd5e9cb3b34eeb95d9fc733d3e570c4e Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 17 May 2016 16:21:30 -0700 Subject: [PATCH 16/46] got search term working but returns all suggestions. login with spotify sort of working --- Gemfile | 1 + Gemfile.lock | 3 ++- app/controllers/sessions_controller.rb | 22 ++++++++++++++++ app/controllers/suggestions_controller.rb | 8 ++++++ app/models/music.rb | 25 +------------------ app/models/user.rb | 15 +++++++++++ app/views/layouts/application.html.erb | 6 +++++ app/views/suggestions/index.html.erb | 8 +++++- app/views/suggestions/show.html.erb | 1 + config/initializers/omniauth.rb | 8 +++--- config/routes.rb | 5 ++++ db/migrate/20160517231850_add_user_columns.rb | 7 ++++++ db/schema.rb | 5 +++- lib/TunesTakeoutWrapper.rb | 20 +++++++++++++++ 14 files changed, 102 insertions(+), 32 deletions(-) create mode 100644 app/views/suggestions/show.html.erb create mode 100644 db/migrate/20160517231850_add_user_columns.rb create mode 100644 lib/TunesTakeoutWrapper.rb diff --git a/Gemfile b/Gemfile index 1b79735..6c5b93e 100644 --- a/Gemfile +++ b/Gemfile @@ -12,6 +12,7 @@ gem 'httparty' gem 'rspotify' gem 'yelp' gem 'simplecov' +gem 'omniauth-oauth2', '~> 1.3.1' gem 'sdoc', '~> 0.4.0', group: :doc group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index d8e17de..4cd0b0c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -101,7 +101,7 @@ GEM omniauth (1.3.1) hashie (>= 1.2, < 4) rack (>= 1.0, < 3) - omniauth-oauth2 (1.4.0) + omniauth-oauth2 (1.3.1) oauth2 (~> 1.0) omniauth (~> 1.2) pg (0.18.4) @@ -191,6 +191,7 @@ DEPENDENCIES httparty jbuilder (~> 2.0) jquery-rails + omniauth-oauth2 (~> 1.3.1) pg (~> 0.15) rails (= 4.2.6) rspotify diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 16d11b5..a32b9fd 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,2 +1,24 @@ class SessionsController < ApplicationController + + def new + + end + + def create + + auth_hash = request.env['omniauth.auth'] + + @user = User.find_or_create_from_omniauth(auth_hash) + if @user + session[:user_id] = @user.id + redirect_to root_path + else + redirect_to root_path, notice: "Failed to save the user" + end + end + + def destroy + session.delete :user_id + redirect_to root_path + end end diff --git a/app/controllers/suggestions_controller.rb b/app/controllers/suggestions_controller.rb index 30719cb..5239700 100644 --- a/app/controllers/suggestions_controller.rb +++ b/app/controllers/suggestions_controller.rb @@ -1,5 +1,13 @@ +require_relative '../../lib/TunesTakeoutWrapper' + class SuggestionsController < ApplicationController def index + + end + def show + @suggestions = TunesTakeoutWrapper.search(params[:term]) + end + end diff --git a/app/models/music.rb b/app/models/music.rb index e0d917d..0c8e577 100644 --- a/app/models/music.rb +++ b/app/models/music.rb @@ -1,27 +1,4 @@ -require 'httparty' -class Music +class Music < ActiveRecord::Base - BASE_URL = "https://tunes-takeout-api.herokuapp.com/v1/" - - # attr_reader :name, :moves, :sprites - - def initialize(data) - # @name = data["name"] - # @moves = data["moves"] - # @sprites = reject_null_sprites(data["sprites"]) - end - - def self.find(id) - data = HTTParty.get(BASE_URL + "suggestions/search/#{id}").parsed_response - self.new(data) - end - - # private - - # def reject_null_sprites(sprite_hash) - # sprite_hash.reject do |name, url| - # url.nil? - # end - end diff --git a/app/models/user.rb b/app/models/user.rb index 8a24969..4c78a0a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,4 +1,19 @@ class User < ActiveRecord::Base validates :provider, presence: true validates :uid, presence: true + + def self.find_or_create_from_omniauth(auth_hash) + user = self.find_by(uid: auth_hash["uid"], provider: auth_hash["provider"]) + if !user.nil? + return user + else + user = User.create(uid: auth_hash["uid"], provider: auth_hash["provider"], name: auth_hash["name"]) + if user.save + return user + else + return nil + end + end + end + end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 4b5582f..eb98a3a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,6 +7,12 @@ <%= csrf_meta_tags %> +
+ +
<%= yield %> diff --git a/app/views/suggestions/index.html.erb b/app/views/suggestions/index.html.erb index ffd60bc..5fc948f 100644 --- a/app/views/suggestions/index.html.erb +++ b/app/views/suggestions/index.html.erb @@ -1 +1,7 @@ -

Something is working

\ No newline at end of file +

Something is working

+ +<%= form_tag search_path do %> +<%= label_tag(:term) %> +<%= text_field_tag(:term) %> +<%= submit_tag("Search") %> +<% end %> \ No newline at end of file diff --git a/app/views/suggestions/show.html.erb b/app/views/suggestions/show.html.erb new file mode 100644 index 0000000..7ead739 --- /dev/null +++ b/app/views/suggestions/show.html.erb @@ -0,0 +1 @@ +<%= @suggestions %> \ No newline at end of file diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index d2ef91f..8f1aab5 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,5 +1,3 @@ -# require 'rspotify/oauth' - -# Rails.application.config.middleware.use OmniAuth::Builder do -# provider :spotify, "SPOTIFY_CLIENT_ID", "SPOTIFY_CLIENT_SECRET", scope: 'user-read-email playlist-modify-public user-library-read user-library-modify' -# end \ No newline at end of file +Rails.application.config.middleware.use OmniAuth::Builder do + provider :spotify, ENV["SPOTIFY_CLIENT_ID"], ENV["SPOTIFY_CLIENT_SECRET"] +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index d4ce000..1b7b589 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,9 @@ Rails.application.routes.draw do root "suggestions#index" + + post "/suggestions" => "suggestions#show", as: "search" + + get "/auth/:provider/callback" => "sessions#create" + delete '/logout' => "sessions#destroy", as: 'logout' end diff --git a/db/migrate/20160517231850_add_user_columns.rb b/db/migrate/20160517231850_add_user_columns.rb new file mode 100644 index 0000000..b7f42b1 --- /dev/null +++ b/db/migrate/20160517231850_add_user_columns.rb @@ -0,0 +1,7 @@ +class AddUserColumns < ActiveRecord::Migration + def change + add_column :users, :provider, :string, null: false + add_column :users, :uid, :string, null: false + add_column :users, :name, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 5c2a66a..05aa9dd 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160516223310) do +ActiveRecord::Schema.define(version: 20160517231850) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -29,6 +29,9 @@ create_table "users", force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "provider", null: false + t.string "uid", null: false + t.string "name" end end diff --git a/lib/TunesTakeoutWrapper.rb b/lib/TunesTakeoutWrapper.rb new file mode 100644 index 0000000..25fe53f --- /dev/null +++ b/lib/TunesTakeoutWrapper.rb @@ -0,0 +1,20 @@ +require 'httparty' + +module TunesTakeoutWrapper + BASE_URL = "https://tunes-takeout-api.herokuapp.com" + + # attr_reader :name, :moves, :sprites + + def self.search(term) + @data = HTTParty.get(BASE_URL + "/v1/suggestions/search?query=#{term}").parsed_response + end + + # private + + # def reject_null_sprites(sprite_hash) + # sprite_hash.reject do |name, url| + # url.nil? + # end + + +end \ No newline at end of file From 0134a65f3d230547fdfab0f968eade294f479d05 Mon Sep 17 00:00:00 2001 From: Jessica Date: Wed, 18 May 2016 13:58:35 -0700 Subject: [PATCH 17/46] music model class and method finally working. prints out array right now --- .idea/.generators | 8 + .idea/.rakeTasks | 7 + .idea/misc.xml | 14 + .idea/modules.xml | 8 + .idea/tunes-takeout.iml | 203 +++++++++ .idea/vcs.xml | 6 + .idea/workspace.xml | 387 ++++++++++++++++++ Gemfile | 1 + Gemfile.lock | 3 + app/controllers/application_controller.rb | 7 + app/controllers/sessions_controller.rb | 4 +- app/controllers/suggestions_controller.rb | 4 +- app/models/food.rb | 2 - app/models/music.rb | 20 +- app/models/user.rb | 10 +- app/views/layouts/application.html.erb | 5 +- app/views/shared/_suggestion | 0 app/views/suggestions/index.html.erb | 4 +- app/views/suggestions/show.html.erb | 2 +- config/routes.rb | 9 +- db/migrate/20160516223304_create_foods.rb | 8 - db/migrate/20160516223310_create_musics.rb | 8 - .../20160517233819_change_null_columns.rb | 6 + db/schema.rb | 6 +- lib/TunesTakeoutWrapper.rb | 2 +- test/fixtures/foods.yml | 11 - test/fixtures/musics.yml | 11 - test/models/food_test.rb | 7 - test/models/music_test.rb | 7 - 29 files changed, 693 insertions(+), 77 deletions(-) create mode 100644 .idea/.generators create mode 100644 .idea/.rakeTasks create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/tunes-takeout.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 app/views/shared/_suggestion delete mode 100644 db/migrate/20160516223304_create_foods.rb delete mode 100644 db/migrate/20160516223310_create_musics.rb create mode 100644 db/migrate/20160517233819_change_null_columns.rb delete mode 100644 test/fixtures/foods.yml delete mode 100644 test/fixtures/musics.yml delete mode 100644 test/models/food_test.rb delete mode 100644 test/models/music_test.rb diff --git a/.idea/.generators b/.idea/.generators new file mode 100644 index 0000000..17d6929 --- /dev/null +++ b/.idea/.generators @@ -0,0 +1,8 @@ + + diff --git a/.idea/.rakeTasks b/.idea/.rakeTasks new file mode 100644 index 0000000..72a34f6 --- /dev/null +++ b/.idea/.rakeTasks @@ -0,0 +1,7 @@ + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..84aa8c4 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6a7f777 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/tunes-takeout.iml b/.idea/tunes-takeout.iml new file mode 100644 index 0000000..7b8a518 --- /dev/null +++ b/.idea/tunes-takeout.iml @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..4a5c1f0 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,387 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1463595494369 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/app/models/music.rb + 13 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Gemfile b/Gemfile index 6c5b93e..5896329 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,7 @@ gem 'rspotify' gem 'yelp' gem 'simplecov' gem 'omniauth-oauth2', '~> 1.3.1' +gem 'omniauth-spotify' gem 'sdoc', '~> 0.4.0', group: :doc group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index 4cd0b0c..39ce026 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,6 +104,8 @@ GEM omniauth-oauth2 (1.3.1) oauth2 (~> 1.0) omniauth (~> 1.2) + omniauth-spotify (0.0.9) + omniauth-oauth2 (~> 1.1) pg (0.18.4) rack (1.6.4) rack-test (0.6.3) @@ -192,6 +194,7 @@ DEPENDENCIES jbuilder (~> 2.0) jquery-rails omniauth-oauth2 (~> 1.3.1) + omniauth-spotify pg (~> 0.15) rails (= 4.2.6) rspotify diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d83690e..66bf3b2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,4 +2,11 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception + + helper_method :current_user + + def current_user + @current_user ||= User.find_by(id: session[:user_id]) + end + end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index a32b9fd..584bfd7 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -4,10 +4,8 @@ def new end - def create - + def create auth_hash = request.env['omniauth.auth'] - @user = User.find_or_create_from_omniauth(auth_hash) if @user session[:user_id] = @user.id diff --git a/app/controllers/suggestions_controller.rb b/app/controllers/suggestions_controller.rb index 5239700..99761f4 100644 --- a/app/controllers/suggestions_controller.rb +++ b/app/controllers/suggestions_controller.rb @@ -6,8 +6,8 @@ def index end def show - @suggestions = TunesTakeoutWrapper.search(params[:term]) - + results = TunesTakeoutWrapper.search(params[:term]) + @music = Music.get_music(results) end end diff --git a/app/models/food.rb b/app/models/food.rb index 3f58467..e69de29 100644 --- a/app/models/food.rb +++ b/app/models/food.rb @@ -1,2 +0,0 @@ -class Food < ActiveRecord::Base -end diff --git a/app/models/music.rb b/app/models/music.rb index 0c8e577..844506b 100644 --- a/app/models/music.rb +++ b/app/models/music.rb @@ -1,4 +1,20 @@ +require_relative '../../lib/TunesTakeoutWrapper' +require 'rspotify' -class Music < ActiveRecord::Base +class Music -end + def self.get_music(results) + results["suggestions"].map do |item| + if item["music_type"] == "artist" + RSpotify::Artist.find(item["music_id"]).name + elsif item["music_type"] == "album" + RSpotify::Album.find(item["music_id"]).name + elsif item["music_type"] == "track" + RSpotify::Track.find(item["music_id"]).name + else + "Not found" + end + end + end + +end \ No newline at end of file diff --git a/app/models/user.rb b/app/models/user.rb index 4c78a0a..2069e7a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,11 +3,15 @@ class User < ActiveRecord::Base validates :uid, presence: true def self.find_or_create_from_omniauth(auth_hash) - user = self.find_by(uid: auth_hash["uid"], provider: auth_hash["provider"]) + user = self.find_by(uid: auth_hash["uid"], provider: auth_hash["provider"], name: auth_hash["display_name"]) if !user.nil? return user else - user = User.create(uid: auth_hash["uid"], provider: auth_hash["provider"], name: auth_hash["name"]) + user = User.new + user.uid = auth_hash["uid"] + user.provider = auth_hash["provider"] + user.name = auth_hash["info"]["name"] + user.save if user.save return user else @@ -15,5 +19,5 @@ def self.find_or_create_from_omniauth(auth_hash) end end end - + end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index eb98a3a..c2d9a08 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,8 +9,9 @@
diff --git a/app/views/shared/_suggestion b/app/views/shared/_suggestion new file mode 100644 index 0000000..e69de29 diff --git a/app/views/suggestions/index.html.erb b/app/views/suggestions/index.html.erb index 5fc948f..6ae7882 100644 --- a/app/views/suggestions/index.html.erb +++ b/app/views/suggestions/index.html.erb @@ -4,4 +4,6 @@ <%= label_tag(:term) %> <%= text_field_tag(:term) %> <%= submit_tag("Search") %> -<% end %> \ No newline at end of file +<% end %> + +<%= render "shared/suggestion" %> diff --git a/app/views/suggestions/show.html.erb b/app/views/suggestions/show.html.erb index 7ead739..d7ece34 100644 --- a/app/views/suggestions/show.html.erb +++ b/app/views/suggestions/show.html.erb @@ -1 +1 @@ -<%= @suggestions %> \ No newline at end of file +<%= @music %> diff --git a/config/routes.rb b/config/routes.rb index 1b7b589..68e3b7f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,9 +1,8 @@ Rails.application.routes.draw do - root "suggestions#index" + root 'suggestions#index' + post '/suggestions' => 'suggestions#show', as: 'search' - post "/suggestions" => "suggestions#show", as: "search" - - get "/auth/:provider/callback" => "sessions#create" - delete '/logout' => "sessions#destroy", as: 'logout' + get '/auth/:provider/callback' => 'sessions#create' + delete '/logout' => 'sessions#destroy', as: 'logout' end diff --git a/db/migrate/20160516223304_create_foods.rb b/db/migrate/20160516223304_create_foods.rb deleted file mode 100644 index 5d62fcd..0000000 --- a/db/migrate/20160516223304_create_foods.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateFoods < ActiveRecord::Migration - def change - create_table :foods do |t| - - t.timestamps null: false - end - end -end diff --git a/db/migrate/20160516223310_create_musics.rb b/db/migrate/20160516223310_create_musics.rb deleted file mode 100644 index 2cc03f3..0000000 --- a/db/migrate/20160516223310_create_musics.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateMusics < ActiveRecord::Migration - def change - create_table :musics do |t| - - t.timestamps null: false - end - end -end diff --git a/db/migrate/20160517233819_change_null_columns.rb b/db/migrate/20160517233819_change_null_columns.rb new file mode 100644 index 0000000..1cd7433 --- /dev/null +++ b/db/migrate/20160517233819_change_null_columns.rb @@ -0,0 +1,6 @@ +class ChangeNullColumns < ActiveRecord::Migration + def change + change_column :users, :uid, :string, null: true + change_column :users, :provider, :string, null: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 05aa9dd..ce03ca5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160517231850) do +ActiveRecord::Schema.define(version: 20160517233819) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -29,8 +29,8 @@ create_table "users", force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.string "provider", null: false - t.string "uid", null: false + t.string "provider" + t.string "uid" t.string "name" end diff --git a/lib/TunesTakeoutWrapper.rb b/lib/TunesTakeoutWrapper.rb index 25fe53f..8e3f3a7 100644 --- a/lib/TunesTakeoutWrapper.rb +++ b/lib/TunesTakeoutWrapper.rb @@ -6,7 +6,7 @@ module TunesTakeoutWrapper # attr_reader :name, :moves, :sprites def self.search(term) - @data = HTTParty.get(BASE_URL + "/v1/suggestions/search?query=#{term}").parsed_response + @data = HTTParty.get(BASE_URL + "/v1/suggestions/search?query=#{term}&limit=20").parsed_response end # private diff --git a/test/fixtures/foods.yml b/test/fixtures/foods.yml deleted file mode 100644 index 937a0c0..0000000 --- a/test/fixtures/foods.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/musics.yml b/test/fixtures/musics.yml deleted file mode 100644 index 937a0c0..0000000 --- a/test/fixtures/musics.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/models/food_test.rb b/test/models/food_test.rb deleted file mode 100644 index 8ad7dff..0000000 --- a/test/models/food_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class FoodTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/test/models/music_test.rb b/test/models/music_test.rb deleted file mode 100644 index c5c6737..0000000 --- a/test/models/music_test.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class MusicTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end From e3f859d498f02943935a9df49b0a6fb7b2185263 Mon Sep 17 00:00:00 2001 From: Jessica Date: Wed, 18 May 2016 19:58:59 -0700 Subject: [PATCH 18/46] got food working from yelp and embedded player working which has image. also some css. --- app/assets/stylesheets/application.css | 18 ++++++++++++++++++ app/controllers/suggestions_controller.rb | 1 + app/models/food.rb | 10 ++++++++++ app/models/music.rb | 11 ++++++----- app/views/layouts/application.html.erb | 1 + app/views/suggestions/show.html.erb | 22 +++++++++++++++++++++- config/application.rb | 2 ++ lib/TunesTakeoutWrapper.rb | 2 +- 8 files changed, 60 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index f9cd5b3..8ac52d5 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -13,3 +13,21 @@ *= require_tree . *= require_self */ + +.music-food { +/* position: relative; + top: 50%; +*/ transform: translateY(20%); +} + + + +img { + border-radius: 25%; + height: 150px; + width: 150px; +} + +a { + text-decoration: none; +} \ No newline at end of file diff --git a/app/controllers/suggestions_controller.rb b/app/controllers/suggestions_controller.rb index 99761f4..7a82003 100644 --- a/app/controllers/suggestions_controller.rb +++ b/app/controllers/suggestions_controller.rb @@ -8,6 +8,7 @@ def index def show results = TunesTakeoutWrapper.search(params[:term]) @music = Music.get_music(results) + @food = Food.get_food(results) end end diff --git a/app/models/food.rb b/app/models/food.rb index e69de29..3cc810c 100644 --- a/app/models/food.rb +++ b/app/models/food.rb @@ -0,0 +1,10 @@ +require 'yelp' + +class Food + + def self.get_food(results) + results["suggestions"].map do |item| + Yelp.client.business(item["food_id"].parameterize).business + end + end +end \ No newline at end of file diff --git a/app/models/music.rb b/app/models/music.rb index 844506b..9d298c4 100644 --- a/app/models/music.rb +++ b/app/models/music.rb @@ -6,15 +6,16 @@ class Music def self.get_music(results) results["suggestions"].map do |item| if item["music_type"] == "artist" - RSpotify::Artist.find(item["music_id"]).name + RSpotify::Artist.find(item["music_id"]) elsif item["music_type"] == "album" - RSpotify::Album.find(item["music_id"]).name + RSpotify::Album.find(item["music_id"]) elsif item["music_type"] == "track" - RSpotify::Track.find(item["music_id"]).name - else - "Not found" + RSpotify::Track.find(item["music_id"]) + else + "" end end + end end \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c2d9a08..7f3ba5d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,6 +3,7 @@ food tunes <%= stylesheet_link_tag 'application', media: 'all' %> + <%= javascript_include_tag 'application' %> <%= csrf_meta_tags %> diff --git a/app/views/suggestions/show.html.erb b/app/views/suggestions/show.html.erb index d7ece34..e57d49d 100644 --- a/app/views/suggestions/show.html.erb +++ b/app/views/suggestions/show.html.erb @@ -1 +1,21 @@ -<%= @music %> +
+ <% @music.each_with_index do |tune, index| %> +
+
+
+ <%= link_to tune.name, tune.external_urls["spotify"] %>
+ <%= tune.type.capitalize %>
+
+
+ <% nom = @food[index] %> + <%= link_to nom.name, nom.url %>
+ <%= nom.location.display_address.join(" ") %>
+ P:<%= nom.display_phone %>
+
+
+ <%= image_tag nom.image_url %>
+
+
+
+ <% end %> +
\ No newline at end of file diff --git a/config/application.rb b/config/application.rb index 9b37a86..e7cd529 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,5 +22,7 @@ class Application < Rails::Application # Do not swallow errors in after_commit/after_rollback callbacks. config.active_record.raise_in_transactional_callbacks = true + config.autoload_paths += %W(#{config.root}/lib) + config.autoload_paths += %W(#{config.root}/extras) end end diff --git a/lib/TunesTakeoutWrapper.rb b/lib/TunesTakeoutWrapper.rb index 8e3f3a7..58e2ef1 100644 --- a/lib/TunesTakeoutWrapper.rb +++ b/lib/TunesTakeoutWrapper.rb @@ -6,7 +6,7 @@ module TunesTakeoutWrapper # attr_reader :name, :moves, :sprites def self.search(term) - @data = HTTParty.get(BASE_URL + "/v1/suggestions/search?query=#{term}&limit=20").parsed_response + @data = HTTParty.get(BASE_URL + "/v1/suggestions/search?query=#{term}").parsed_response end # private From 3cc72ff0eddebbadd9fb6537ee4fae12da468f15 Mon Sep 17 00:00:00 2001 From: Jessica Date: Thu, 19 May 2016 11:10:46 -0700 Subject: [PATCH 19/46] top 20 pairings for index page working. set up for search for logged in users only works. some css --- app/assets/images/spotify_logo.jpg | Bin 0 -> 6041 bytes app/assets/stylesheets/application.css | 47 +++++++++++++++++++--- app/controllers/suggestions_controller.rb | 8 +++- app/models/food.rb | 2 +- app/models/music.rb | 2 +- app/views/layouts/application.html.erb | 14 +++++-- app/views/shared/_suggestion | 0 app/views/shared/_suggestion.html.erb | 21 ++++++++++ app/views/suggestions/index.html.erb | 16 ++++---- app/views/suggestions/show.html.erb | 24 ++--------- config/application.rb | 4 +- lib/TunesTakeoutWrapper.rb | 24 ++++++----- 12 files changed, 108 insertions(+), 54 deletions(-) create mode 100644 app/assets/images/spotify_logo.jpg delete mode 100644 app/views/shared/_suggestion create mode 100644 app/views/shared/_suggestion.html.erb diff --git a/app/assets/images/spotify_logo.jpg b/app/assets/images/spotify_logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2afb1404cf65139aed55572a95469ad4da30f550 GIT binary patch literal 6041 zcmd6rcT`i)w#P&7O?pJ4w9r8a7Fwh?5dk4IiGcJU2-0gr1o=fEAP5qrcPWuh=v6>^ zN01hJm0m-5c;CDC-Fw$tul@1X+h={(oU>-utoh9BGqd+xPF&6b7`4^4)B!|9007a| z1Gt<5r~oL*$tlRmC@Cl?sHiBZX<6uKX=rFUuQ4;Q+yH{OZveTtZt{tPZ}N!pa&ZaX z6%v)a4S_&F;QI>qq~yh=AyU6PA)=z9qNSnbprhlEy2W)%>VIsPO#mj!-(w;n;sFpd z5s@$vUA6&0SK}lj`ilYn&4`FeNXf`4D52PcqU04yjZ43W8W_uhS3 z6;(BL4NWa=!zV_@FcVWVo9DK6_709t9-dy_KE8hbp>M*%-$wk2d>N5TYv0!|4?!8GFk zcM{Rj+94Da>nyE}8T5y~p0i?K?+DR0(1*p9lH5Taih<`2idheXRKbPDtzg0#bk4bC zm~i97x``Mvn%uE#aXStgvT%S=EOt}|iUm=6G3_sz=+Jbj+mt7FoZpUvKQeb5Gk!*6 ze(xqpxqcWyxe!;ql;SvBybzBUrJPTTph9~=cvEm6`WfT9J*l{MOJrbpiojZRyCA5BK--&God-dCd_9{M84_FAI()_ zP1KKt9^?{P^v1`$GQg#fi3@WfHBl^Yo>XV?gxxG*Vi^)P5Xv&j(NPsgt{RO<#lEKO z>#b&)*hNY(S5e2i$ON-~6>T=I|-UKmU-T1Vg`zc#V;la9_@MJUISCL-9WR z$b5kC_5hR7yv&5z?$!#n8%RE|7gJ+_WjL_ts{#Hav0~?6&`$fNK4BYJy7>^YZ}SGe zs}N@AIK~dlNhgcSc#&d9oq3jOHP-NUXF1e)ews(*`ZFpJ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GC)#B;VZk2^sXX!7Qs|f7Xe%FRv);4ZCMQAh}c(gVPL%65!jnh^}Nbh znu>9!doboqa?^Rmzc$CIszzaQ+N5t#Q+6SfL0JxoYnxjzpNWp_^Bk!#PgT1*9p?iT zcDY;ismOCHzpv!%Av`-a@KDss)6$xna05=w&YO$CT_^qIyN(51ed2QO?Ghn9gXr%q z)mO8Z*~^*z3@hL${qSm%n%z$`e^+_aMEBl;{2T}47(kBxlD;kzmebMl)l*A`gkgkI zoS9*^aP%MysJrQzIDS;)k~wYpFs3Oq!R9O=)oFK@-FIxE?b>y7mjTD`zIwR0>Bg3l zLky#n?8SI;(49HOMV%J#0K&2&(Xx-7G(TW?G?_8GyWnb`YI~LctNXQz0~GW687J}g ztv9C2?58mVirjf*XGV^G7ddwXe|G@7ksptKv&4R`EmkzRbR_#{XH-iM;i$-vANTq~5Qj?R}_cZJ!aSew>o@FxO zzu=rF+ia)`;DVO`yZMg8VxI)X_q-E+smjYSUmxo*0@if{PbLYa3v>muUyrdK7fzqY zVeAyr{i2P(urF4$Y*B@w6MiYj0k|M$J&G;a
- +
<%= yield %> diff --git a/app/views/shared/_suggestion b/app/views/shared/_suggestion deleted file mode 100644 index e69de29..0000000 diff --git a/app/views/shared/_suggestion.html.erb b/app/views/shared/_suggestion.html.erb new file mode 100644 index 0000000..330407b --- /dev/null +++ b/app/views/shared/_suggestion.html.erb @@ -0,0 +1,21 @@ +
+ <% @music.each_with_index do |tune, index| %> +
+
+
+ <%= link_to tune.name, tune.external_urls["spotify"] %>
+ <%= tune.type.capitalize %>
+
+
+ <% nom = @food[index] %> + <%= link_to nom.name, nom.url %>
+ <%= nom.location.display_address.join(" ") %>
+ P: <%= nom.display_phone %>
+
+
+ <%= image_tag nom.image_url, class: "food-img" %>
+
+
+
+ <% end %> +
\ No newline at end of file diff --git a/app/views/suggestions/index.html.erb b/app/views/suggestions/index.html.erb index 6ae7882..c549f4b 100644 --- a/app/views/suggestions/index.html.erb +++ b/app/views/suggestions/index.html.erb @@ -1,9 +1,11 @@ -

Something is working

- -<%= form_tag search_path do %> -<%= label_tag(:term) %> -<%= text_field_tag(:term) %> -<%= submit_tag("Search") %> +<% if current_user %> +

Enter a word or phrase to get a pairing!

+ <%= form_tag search_path do %> + <%= label_tag(:"Word/Phrase:") %> + <%= text_field_tag(:term) %> + <%= submit_tag("Search") %> + <% end %> <% end %> -<%= render "shared/suggestion" %> +

Top 20 Pairings!

+<%= render 'shared/suggestion' %> \ No newline at end of file diff --git a/app/views/suggestions/show.html.erb b/app/views/suggestions/show.html.erb index e57d49d..c2cc500 100644 --- a/app/views/suggestions/show.html.erb +++ b/app/views/suggestions/show.html.erb @@ -1,21 +1,3 @@ -
- <% @music.each_with_index do |tune, index| %> -
-
-
- <%= link_to tune.name, tune.external_urls["spotify"] %>
- <%= tune.type.capitalize %>
-
-
- <% nom = @food[index] %> - <%= link_to nom.name, nom.url %>
- <%= nom.location.display_address.join(" ") %>
- P:<%= nom.display_phone %>
-
-
- <%= image_tag nom.image_url %>
-
-
-
- <% end %> -
\ No newline at end of file +

Pairings for <%= params[:term] %>

+
+<%= render 'shared/suggestion' %> \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index e7cd529..d82a75c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,7 +22,7 @@ class Application < Rails::Application # Do not swallow errors in after_commit/after_rollback callbacks. config.active_record.raise_in_transactional_callbacks = true - config.autoload_paths += %W(#{config.root}/lib) - config.autoload_paths += %W(#{config.root}/extras) + config.autoload_paths << "#{Rails.root}/lib" + config.eager_load_paths << "#{Rails.root}/lib" end end diff --git a/lib/TunesTakeoutWrapper.rb b/lib/TunesTakeoutWrapper.rb index 58e2ef1..c27f4ae 100644 --- a/lib/TunesTakeoutWrapper.rb +++ b/lib/TunesTakeoutWrapper.rb @@ -3,18 +3,22 @@ module TunesTakeoutWrapper BASE_URL = "https://tunes-takeout-api.herokuapp.com" - # attr_reader :name, :moves, :sprites + def self.top_suggestions + top_array = [] + top = HTTParty.get(BASE_URL + "/v1/suggestions/top").parsed_response["suggestions"] + top.each do |suggestion| + top_array << HTTParty.get(BASE_URL + "/v1/suggestions/" + "#{suggestion}") + end + one_result = [] + top_array.each do |result| + one_result << result["suggestion"] + # raise + end + return one_result + end def self.search(term) - @data = HTTParty.get(BASE_URL + "/v1/suggestions/search?query=#{term}").parsed_response + data = HTTParty.get(BASE_URL + "/v1/suggestions/search?query=#{term}").parsed_response end - # private - - # def reject_null_sprites(sprite_hash) - # sprite_hash.reject do |name, url| - # url.nil? - # end - - end \ No newline at end of file From 895c3c7e74aa96e904e332946f7449679d3a3ca0 Mon Sep 17 00:00:00 2001 From: Jessica Date: Thu, 19 May 2016 13:54:51 -0700 Subject: [PATCH 20/46] starting to work on favorite --- app/controllers/suggestions_controller.rb | 12 ++++++++++++ app/views/layouts/application.html.erb | 7 +++++-- config/routes.rb | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/controllers/suggestions_controller.rb b/app/controllers/suggestions_controller.rb index 7557afd..2e14873 100644 --- a/app/controllers/suggestions_controller.rb +++ b/app/controllers/suggestions_controller.rb @@ -15,4 +15,16 @@ def show @food = Food.get_food(results) end + def favorites + + end + + def favorite + + end + + def unfavorite + + end + end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index da1b4a3..2d45afb 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,11 +12,14 @@ diff --git a/config/routes.rb b/config/routes.rb index 68e3b7f..97b4e03 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,6 +3,9 @@ root 'suggestions#index' post '/suggestions' => 'suggestions#show', as: 'search' + get '/:user_id/favorites' => 'suggestions#favorites', as: 'favorites' + post '/:user_id/favorites' => 'suggestions#favorites' + get '/auth/:provider/callback' => 'sessions#create' delete '/logout' => 'sessions#destroy', as: 'logout' end From 0ba5f51b69644526b4094bb53b6ad1fc75d604d7 Mon Sep 17 00:00:00 2001 From: Jessica Date: Thu, 19 May 2016 15:09:15 -0700 Subject: [PATCH 21/46] user image now pulling from spotify --- app/assets/stylesheets/application.css | 3 ++- app/controllers/sessions_controller.rb | 4 ++++ app/controllers/suggestions_controller.rb | 2 +- app/models/user.rb | 3 ++- app/views/layouts/application.html.erb | 7 +++++-- db/migrate/20160519214326_add_spotify_image.rb | 5 +++++ db/schema.rb | 3 ++- 7 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20160519214326_add_spotify_image.rb diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 176b906..d60c97d 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -57,12 +57,13 @@ div.header { .logo { height: 50px; width: 50px; + border-radius: 50%; } p.header-spotify { font-size: 16px; font-style: italic; margin-top: 2%; - padding-left: 5%; + padding-left: 15%; color: green; } \ No newline at end of file diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 584bfd7..58d5029 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -6,6 +6,7 @@ def new def create auth_hash = request.env['omniauth.auth'] + if auth_hash["uid"] @user = User.find_or_create_from_omniauth(auth_hash) if @user session[:user_id] = @user.id @@ -13,6 +14,9 @@ def create else redirect_to root_path, notice: "Failed to save the user" end + else + redirect_to root_path, notice: "Failed to authenticate" + end end def destroy diff --git a/app/controllers/suggestions_controller.rb b/app/controllers/suggestions_controller.rb index 2e14873..16b93f0 100644 --- a/app/controllers/suggestions_controller.rb +++ b/app/controllers/suggestions_controller.rb @@ -1,7 +1,7 @@ require_relative '../../lib/TunesTakeoutWrapper' class SuggestionsController < ApplicationController - before_action :require_login, only: [:show] + # before_action :require_login, only: [:show] def index results = TunesTakeoutWrapper.top_suggestions diff --git a/app/models/user.rb b/app/models/user.rb index 2069e7a..700a403 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,7 +3,7 @@ class User < ActiveRecord::Base validates :uid, presence: true def self.find_or_create_from_omniauth(auth_hash) - user = self.find_by(uid: auth_hash["uid"], provider: auth_hash["provider"], name: auth_hash["display_name"]) + user = self.find_by(uid: auth_hash["uid"], provider: auth_hash["provider"]) if !user.nil? return user else @@ -11,6 +11,7 @@ def self.find_or_create_from_omniauth(auth_hash) user.uid = auth_hash["uid"] user.provider = auth_hash["provider"] user.name = auth_hash["info"]["name"] + user.image_url = auth_hash["info"]["image"] user.save if user.save return user diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2d45afb..714e9a7 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,9 +12,12 @@ diff --git a/app/views/suggestions/index.html.erb b/app/views/suggestions/index.html.erb index 63cce78..2e14090 100644 --- a/app/views/suggestions/index.html.erb +++ b/app/views/suggestions/index.html.erb @@ -1,9 +1,8 @@ <% if current_user %>

Enter a word or phrase to get a pairing!

- <%= form_for search_path(params[:term]), method: :post do |f| %> - <%= f.label(:"Word/Phrase:") %> - <%= f.text_field(:term) %> - <%= f.submit("Search") %> + <%= form_tag search_path do %> + <%= text_field_tag(:term) %> + <%= submit_tag("Search") %> <% end %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index d6d2a4a..68024cb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,8 +2,8 @@ root 'suggestions#index' - get '/suggestions/:term' => 'suggestions#show', as: 'search' - post '/suggestions/:term' => 'suggestions#show' + # get '/suggestions/:term' => 'suggestions#show' + post '/suggestions' => 'suggestions#show', as: 'search' get '/:user_id/favorites' => 'suggestions#favorites', as: 'favorites' diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index 7437838..8f79301 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -1,5 +1,5 @@ -first_user: - uid: "person_one" - name: "Person One" +known_user: + uid: "known_user" + name: "known user" provider: "spotify" image_url: "http//cats.com" \ No newline at end of file diff --git a/test/models/music_test.rb b/test/models/music_test.rb index eeb9079..923f1d5 100644 --- a/test/models/music_test.rb +++ b/test/models/music_test.rb @@ -2,7 +2,7 @@ class Music < ActiveSupport::TestCase -describe Music do + # describe Music do # describe "API" do # describe "Album" do @@ -16,6 +16,6 @@ class Music < ActiveSupport::TestCase # end # end # end -end + # end end \ No newline at end of file diff --git a/test/models/user_test.rb b/test/models/user_test.rb index b9c3bc5..9aa10e6 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -15,33 +15,50 @@ class UserTest < ActiveSupport::TestCase assert user.errors.keys.include?(:provider), "provider is not in the errors hash" end - def setup - @known = OmniAuth.config.mock_auth[:known_user] - # @unknown = OmniAuth.config.mock_auth[:spotify_unknown] - # @unknown_with_uid = OmniAuth.config.mock_auth[:spotify_uid] + def setup + @known = { + "provider" => "spotify", + "uid" => "known_user", + "info" => + { "name" => "known user" , "images" => ["url" => "http://cats.com"]} + } + + @unknown = { + "provider" => "spotify", + "uid" => "unknown_user", + "info" => + { "id" => "unknown_user", "name" => "unknown user" , "images" => ["url" => "http://cats.com"]} + } + + @unknown_with_uid = { + "provider" => "spotify", + "uid" => "unknown_user_id", + "info" => + { "id" => "unknown_user_id", "name" => "unknown user id" , "images" => ["url" => "http://cats.com"]} + } end test "can find an existing user given an oauth spotify hash" do assert_equal users(:known_user), User.find_or_create_from_omniauth(@known) end - # test "can make a new user given the oauth spotify hash of an unknown user" do - # assert_difference 'User.count', 1 do - # @user = User.find_or_create_from_omniauth @unknown - # end - # end + test "can make new user given oauth spotify hash of unknown user" do + assert_difference 'User.count', 1 do + @user = User.find_or_create_from_omniauth @unknown + end + end - # test "uses oauth data to set user name, provider and uid for new users" do - # user = User.find_or_create_from_omniauth @unknown + test "uses oauth data to set user name, provider, uid for new users" do + user = User.find_or_create_from_omniauth @unknown - # assert_equal @unknown['info']['display_name'], user.name - # assert_equal @unknown['provider'], user.provider - # assert_equal @unknown['info']['id'], user.uid - # end + assert_equal @unknown['info']['name'], user.name + assert_equal @unknown['provider'], user.provider + assert_equal @unknown['uid'], user.uid + end - # test "prefers a top-level uid over a nested id when creating an oauth user" do - # user = User.find_or_create_from_omniauth @unknown_with_uid - # assert_equal @unknown_with_uid['uid'], user.uid - # end + test "prefers a top-level uid over a nested id when creating an oauth user" do + user = User.find_or_create_from_omniauth @unknown_with_uid + assert_equal @unknown_with_uid['uid'], user.uid + end end diff --git a/test/test_helper.rb b/test/test_helper.rb index a5bbfb5..bf0be0b 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -22,8 +22,9 @@ class ActiveSupport::TestCase - # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all - - # Add more helper methods to be used by all tests here... + def setup + OmniAuth.config.test_mode = true + OmniAuth.config.mock_auth[:spotify] = OmniAuth::AuthHash.new({:provider => 'spotify', :uid => 'musiclover', info: { name: "music lover", id: "12345"}}) + end end From 62698ee6089de3aa2e16dde5867855f80469c35c Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 22 May 2016 11:48:13 -0700 Subject: [PATCH 31/46] working on wrapper testing. lookin good --- ..._suggestion_info_given_a_suggestion_id.yml | 911 ++++++++++++++++++ .../API/can_retrieve_top_20_suggestions.yml | 911 ++++++++++++++++++ ...eturn_20_suggestions_after_user_search.yml | 911 ++++++++++++++++++ test/models/TunesTakeoutWrapper_test.rb | 43 +- 4 files changed, 2761 insertions(+), 15 deletions(-) create mode 100644 test/cassettes/TunesTakeoutWrapper/API/can_retrieve_a_hash_of_suggestion_info_given_a_suggestion_id.yml create mode 100644 test/cassettes/TunesTakeoutWrapper/API/can_retrieve_top_20_suggestions.yml create mode 100644 test/cassettes/TunesTakeoutWrapper/API/can_return_20_suggestions_after_user_search.yml diff --git a/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_a_hash_of_suggestion_info_given_a_suggestion_id.yml b/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_a_hash_of_suggestion_info_given_a_suggestion_id.yml new file mode 100644 index 0000000..c8a4e56 --- /dev/null +++ b/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_a_hash_of_suggestion_info_given_a_suggestion_id.yml @@ -0,0 +1,911 @@ +--- +http_interactions: +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:06 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:07 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/top + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:07 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '474' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9Q","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:07 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE- + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:07 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE-","suggestion":{"id":"Vz0KQY-RRwADboE-","food_id":"a-la-mode-pies-seattle","music_id":"1OYLLmDS0pJVFRbUo19vrG","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:07 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:07 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '224' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ","suggestion":{"id":"Vz0KQY-RRwADboEQ","food_id":"old-school-frozen-custard-seattle","music_id":"1hq33mOCO3eLxvgBl0leqP","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:08 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:08 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '221' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:08 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:09 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '212' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29","suggestion":{"id":"Vz0KNY-RRwADbn29","food_id":"sweet-iron-seattle-2","music_id":"0cOpQTKJdCEzz2wplnnyP6","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:09 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:09 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:09 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:09 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:09 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:09 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '226' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:10 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:10 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '219' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:10 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:10 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:11 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:11 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '209' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:11 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:11 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:11 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:11 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '215' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:12 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:12 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:12 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:12 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:13 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:13 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '228' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I","suggestion":{"id":"Vz0KO4-RRwADbn9I","food_id":"memos-mexican-food-restaurant-seattle","music_id":"4OpGuePj1YVgTIXi2WLHVn","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:13 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:13 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '216' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U","suggestion":{"id":"Vz0KO4-RRwADbn9U","food_id":"malenas-taco-shop-seattle","music_id":"1mFWLJb6bVP4IroYrJVV5R","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:13 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:13 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '223' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x","suggestion":{"id":"Vz0KO4-RRwADbn8x","food_id":"blue-water-taco-grill-seattle-14","music_id":"1pujwuePmCgDFQY32P5elo","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:14 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:14 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '229' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85","suggestion":{"id":"Vz0KO4-RRwADbn85","food_id":"taqueria-costa-alegre-taco-bus-seattle","music_id":"4QB9QRThl5plfwJmcpFtcp","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:14 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:14 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n","suggestion":{"id":"Vz0KNY-RRwADbn2n","food_id":"crepe-cafe-and-wine-bar-seattle","music_id":"18XycAkvLpkbHoWqGCgIwN","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:15 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:15 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b","suggestion":{"id":"Vz0KO4-RRwADbn9b","food_id":"tacos-chukis-seattle","music_id":"0AyB84D5n6ISyfZMA84NML","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:15 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/search?query=honey + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:21 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '2558' + Via: + - 1.1 vegur + body: + encoding: ASCII-8BIT + string: !binary |- + eyJocmVmIjoiaHR0cHM6Ly90dW5lcy10YWtlb3V0LWFwaS5oZXJva3VhcHAu + Y29tL3YxL3N1Z2dlc3Rpb25zL3NlYXJjaD9xdWVyeT1ob25leVx1MDAyNmxp + bWl0PTIwXHUwMDI2c2VlZD1ob25leSIsInN1Z2dlc3Rpb25zIjpbeyJpZCI6 + IlYwRFpiejJPaEFBRHVTVHkiLCJmb29kX2lkIjoiYnJvb2tmaWVsZC1mYXJt + LWJlZXMtYW5kLWhvbmV5LXNlYXR0bGUiLCJtdXNpY19pZCI6IjE1V29ZYUZh + bkF5bUladWViZnh2T3QiLCJtdXNpY190eXBlIjoidHJhY2sifSx7ImlkIjoi + VjBIc1kxRWxKd0FEekZ1eCIsImZvb2RfaWQiOiJoYXJkd29rLWNhZmUtc2Vh + dHRsZSIsIm11c2ljX2lkIjoiMXNBZkRKNnI3VUpTczZ0emd5bHJKTCIsIm11 + c2ljX3R5cGUiOiJ0cmFjayJ9LHsiaWQiOiJWejBSWFFqTnFBQURCYnM3Iiwi + Zm9vZF9pZCI6ImNhZsOpLXByZXNzZS1zZWF0dGxlLTIiLCJtdXNpY19pZCI6 + IjAwZnRKTTNMQmYxRTV1b0dQZTViejIiLCJtdXNpY190eXBlIjoiYXJ0a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XVzaWNfdHlwZSI6ImFydGlz + dCJ9LHsiaWQiOiJWejBSWGdqTnFBQURCYnRKIiwiZm9vZF9pZCI6ImNhZmbD + qC10b3Jpbm8tc2VhdHRsZS0yIiwibXVzaWNfaWQiOiIxZVlmRW9Od0NJT2w3 + cG0zd3RkNGVFIiwibXVzaWNfdHlwZSI6ImFsYnVtIn0seyJpZCI6IlYwSHNZ + MUVsSndBRHpGdXoiLCJmb29kX2lkIjoiY2hlZi1saWFvLWFzaWFuLWZ1c2lv + bi1jdWlzaW5lLXNlYXR0bGUiLCJtdXNpY19pZCI6IjF0dUlBT1hCU01DcEdO + NFhQc3Zia2ciLCJtdXNpY190eXBlIjoiYXJ0aXN0In0seyJpZCI6IlYwRFpj + RDJPaEFBRHVTVDkiLCJmb29kX2lkIjoianVzLWJhci1zZWF0dGxlIiwibXVz + aWNfaWQiOiIwNmRyNEc2clptbFFiVExBb2U4VzdxIiwibXVzaWNfdHlwZSI6 + ImFydGlzdCJ9LHsiaWQiOiJWMERaY0QyT2hBQUR1U1QtIiwiZm9vZF9pZCI6 + ImthdHN1LWJ1cmdlci1zZWF0dGxlIiwibXVzaWNfaWQiOiIxV1RwNjl6V3Zz + bHdveUJBcklLQVh6IiwibXVzaWNfdHlwZSI6ImFydGlzdCJ9XX0= + http_version: + recorded_at: Sun, 22 May 2016 18:47:21 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_top_20_suggestions.yml b/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_top_20_suggestions.yml new file mode 100644 index 0000000..9d3e711 --- /dev/null +++ b/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_top_20_suggestions.yml @@ -0,0 +1,911 @@ +--- +http_interactions: +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:37 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:37 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/top + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:38 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '474' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9Q","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:37 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE- + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:38 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE-","suggestion":{"id":"Vz0KQY-RRwADboE-","food_id":"a-la-mode-pies-seattle","music_id":"1OYLLmDS0pJVFRbUo19vrG","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:38 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:38 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '224' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ","suggestion":{"id":"Vz0KQY-RRwADboEQ","food_id":"old-school-frozen-custard-seattle","music_id":"1hq33mOCO3eLxvgBl0leqP","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:38 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:39 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '221' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:39 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:39 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '212' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29","suggestion":{"id":"Vz0KNY-RRwADbn29","food_id":"sweet-iron-seattle-2","music_id":"0cOpQTKJdCEzz2wplnnyP6","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:39 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:39 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:39 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:40 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:40 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:41 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '226' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:40 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:41 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '219' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:41 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:42 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:41 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:41 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '209' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:42 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:42 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:42 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:42 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '215' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:42 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:42 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:43 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:43 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:43 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:44 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '228' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I","suggestion":{"id":"Vz0KO4-RRwADbn9I","food_id":"memos-mexican-food-restaurant-seattle","music_id":"4OpGuePj1YVgTIXi2WLHVn","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:43 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:44 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '216' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U","suggestion":{"id":"Vz0KO4-RRwADbn9U","food_id":"malenas-taco-shop-seattle","music_id":"1mFWLJb6bVP4IroYrJVV5R","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:44 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:44 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '223' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x","suggestion":{"id":"Vz0KO4-RRwADbn8x","food_id":"blue-water-taco-grill-seattle-14","music_id":"1pujwuePmCgDFQY32P5elo","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:44 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:44 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '229' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85","suggestion":{"id":"Vz0KO4-RRwADbn85","food_id":"taqueria-costa-alegre-taco-bus-seattle","music_id":"4QB9QRThl5plfwJmcpFtcp","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:45 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:44 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n","suggestion":{"id":"Vz0KNY-RRwADbn2n","food_id":"crepe-cafe-and-wine-bar-seattle","music_id":"18XycAkvLpkbHoWqGCgIwN","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:45 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:45 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b","suggestion":{"id":"Vz0KO4-RRwADbn9b","food_id":"tacos-chukis-seattle","music_id":"0AyB84D5n6ISyfZMA84NML","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:45 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/search?query=honey + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:51 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '2558' + Via: + - 1.1 vegur + body: + encoding: ASCII-8BIT + string: !binary |- + eyJocmVmIjoiaHR0cHM6Ly90dW5lcy10YWtlb3V0LWFwaS5oZXJva3VhcHAu + Y29tL3YxL3N1Z2dlc3Rpb25zL3NlYXJjaD9xdWVyeT1ob25leVx1MDAyNmxp + bWl0PTIwXHUwMDI2c2VlZD1ob25leSIsInN1Z2dlc3Rpb25zIjpbeyJpZCI6 + IlYwRFpiejJPaEFBRHVTVHkiLCJmb29kX2lkIjoiYnJvb2tmaWVsZC1mYXJt + LWJlZXMtYW5kLWhvbmV5LXNlYXR0bGUiLCJtdXNpY19pZCI6IjE1V29ZYUZh + bkF5bUladWViZnh2T3QiLCJtdXNpY190eXBlIjoidHJhY2sifSx7ImlkIjoi + VjBIc1kxRWxKd0FEekZ1eCIsImZvb2RfaWQiOiJoYXJkd29rLWNhZmUtc2Vh + dHRsZSIsIm11c2ljX2lkIjoiMXNBZkRKNnI3VUpTczZ0emd5bHJKTCIsIm11 + c2ljX3R5cGUiOiJ0cmFjayJ9LHsiaWQiOiJWejBSWFFqTnFBQURCYnM3Iiwi + Zm9vZF9pZCI6ImNhZsOpLXByZXNzZS1zZWF0dGxlLTIiLCJtdXNpY19pZCI6 + IjAwZnRKTTNMQmYxRTV1b0dQZTViejIiLCJtdXNpY190eXBlIjoiYXJ0aXN0 + In0seyJpZCI6IlYwRFpjRDJPaEFBRHVTVDAiLCJmb29kX2lkIjoibGVlcy1h + c2lhbi1yZXN0YXVyYW50LXNlYXR0bGUiLCJtdXNpY19pZCI6IjB5MFFwbWNG + MUczRjc5cmprM2ZqVXgiLCJtdXNpY190eXBlIjoidHJhY2sifSx7ImlkIjoi + V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sYnVtIn0seyJpZCI6IlYwSHNZ + MUVsSndBRHpGdXoiLCJmb29kX2lkIjoiY2hlZi1saWFvLWFzaWFuLWZ1c2lv + bi1jdWlzaW5lLXNlYXR0bGUiLCJtdXNpY19pZCI6IjF0dUlBT1hCU01DcEdO + NFhQc3Zia2ciLCJtdXNpY190eXBlIjoiYXJ0aXN0In0seyJpZCI6IlYwRFpj + RDJPaEFBRHVTVDkiLCJmb29kX2lkIjoianVzLWJhci1zZWF0dGxlIiwibXVz + aWNfaWQiOiIwNmRyNEc2clptbFFiVExBb2U4VzdxIiwibXVzaWNfdHlwZSI6 + ImFydGlzdCJ9LHsiaWQiOiJWMERaY0QyT2hBQUR1U1QtIiwiZm9vZF9pZCI6 + ImthdHN1LWJ1cmdlci1zZWF0dGxlIiwibXVzaWNfaWQiOiIxV1RwNjl6V3Zz + bHdveUJBcklLQVh6IiwibXVzaWNfdHlwZSI6ImFydGlzdCJ9XX0= + http_version: + recorded_at: Sun, 22 May 2016 18:47:51 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/TunesTakeoutWrapper/API/can_return_20_suggestions_after_user_search.yml b/test/cassettes/TunesTakeoutWrapper/API/can_return_20_suggestions_after_user_search.yml new file mode 100644 index 0000000..5e4be1e --- /dev/null +++ b/test/cassettes/TunesTakeoutWrapper/API/can_return_20_suggestions_after_user_search.yml @@ -0,0 +1,911 @@ +--- +http_interactions: +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:22 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:21 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/top + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:21 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '474' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9Q","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:22 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE- + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:22 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE-","suggestion":{"id":"Vz0KQY-RRwADboE-","food_id":"a-la-mode-pies-seattle","music_id":"1OYLLmDS0pJVFRbUo19vrG","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:22 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:22 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '224' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ","suggestion":{"id":"Vz0KQY-RRwADboEQ","food_id":"old-school-frozen-custard-seattle","music_id":"1hq33mOCO3eLxvgBl0leqP","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:22 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:23 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '221' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:23 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:23 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '212' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29","suggestion":{"id":"Vz0KNY-RRwADbn29","food_id":"sweet-iron-seattle-2","music_id":"0cOpQTKJdCEzz2wplnnyP6","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:23 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:23 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:24 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:23 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:24 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:24 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '226' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:24 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:25 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '219' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:25 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:25 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:25 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:25 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '209' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:25 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:25 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:26 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:26 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '215' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:26 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:26 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:26 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:26 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:27 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:27 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '228' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I","suggestion":{"id":"Vz0KO4-RRwADbn9I","food_id":"memos-mexican-food-restaurant-seattle","music_id":"4OpGuePj1YVgTIXi2WLHVn","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:27 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:27 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '216' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U","suggestion":{"id":"Vz0KO4-RRwADbn9U","food_id":"malenas-taco-shop-seattle","music_id":"1mFWLJb6bVP4IroYrJVV5R","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:28 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:28 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '223' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x","suggestion":{"id":"Vz0KO4-RRwADbn8x","food_id":"blue-water-taco-grill-seattle-14","music_id":"1pujwuePmCgDFQY32P5elo","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:28 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:29 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '229' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85","suggestion":{"id":"Vz0KO4-RRwADbn85","food_id":"taqueria-costa-alegre-taco-bus-seattle","music_id":"4QB9QRThl5plfwJmcpFtcp","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:28 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:28 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n","suggestion":{"id":"Vz0KNY-RRwADbn2n","food_id":"crepe-cafe-and-wine-bar-seattle","music_id":"18XycAkvLpkbHoWqGCgIwN","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:29 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:30 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b","suggestion":{"id":"Vz0KO4-RRwADbn9b","food_id":"tacos-chukis-seattle","music_id":"0AyB84D5n6ISyfZMA84NML","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 18:47:29 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/search?query=honey + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 18:47:36 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '2558' + Via: + - 1.1 vegur +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XJ0aXN0In0seyJpZCI6IlYwRFpj + RDJPaEFBRHVTVDkiLCJmb29kX2lkIjoianVzLWJhci1zZWF0dGxlIiwibXVz + aWNfaWQiOiIwNmRyNEc2clptbFFiVExBb2U4VzdxIiwibXVzaWNfdHlwZSI6 + ImFydGlzdCJ9LHsiaWQiOiJWMERaY0QyT2hBQUR1U1QtIiwiZm9vZF9pZCI6 + ImthdHN1LWJ1cmdlci1zZWF0dGxlIiwibXVzaWNfaWQiOiIxV1RwNjl6V3Zz + bHdveUJBcklLQVh6IiwibXVzaWNfdHlwZSI6ImFydGlzdCJ9XX0= + http_version: + recorded_at: Sun, 22 May 2016 18:47:36 GMT +recorded_with: VCR 3.0.2 diff --git a/test/models/TunesTakeoutWrapper_test.rb b/test/models/TunesTakeoutWrapper_test.rb index 15c3c57..4fc2042 100644 --- a/test/models/TunesTakeoutWrapper_test.rb +++ b/test/models/TunesTakeoutWrapper_test.rb @@ -1,27 +1,40 @@ require 'test_helper' -require 'TunesTakeoutWrapper' +require "TunesTakeoutWrapper" class TunesTakeoutWrapperTest < ActiveSupport::TestCase -describe TunesTakeoutWrapper do + describe TunesTakeoutWrapper do - it "uses v1 of the API" do - assert_equal "https://tunes-takeout-api.herokuapp.com/v1", TunesTakeoutWrapper::BASE_URL - end + it "uses v1 of the API" do + assert_equal "https://tunes-takeout-api.herokuapp.com/v1", TunesTakeoutWrapper::BASE_URL + end + + describe "API", :vcr do + before do + @suggestion_id = TunesTakeoutWrapper.get_suggestion("Vz0KO4-RRwADbn9c") + @top_suggestions = TunesTakeoutWrapper.top_suggestions + @search = TunesTakeoutWrapper.search("honey") + end + + it "can retrieve a hash of suggestion info given a suggestion id", :vcr do + assert_kind_of Hash, @suggestion_id + end + + it "can retrieve top 20 suggestions", :vcr do + assert_equal 20, @top_suggestions.length + end - # describe "API" do - # before do - # results = {"id"=>"Vz0KNY-RRwADbn2k", "food_id"=>"ohana-seattle-2", "music_id"=>"0DeXBSPxuMGmgT1MSrzXe2", "music_type"=>"album"} - # @banana_album = Music.get_music(results) - # end + it "can return 20 suggestions after user search", :vcr do + assert_equal 20, @search.length + end - # it "can find an album name", :vcr do - # assert_equal "Banana Slug String Band", @banana_album.name - # end - # end -end + + end + + + end end \ No newline at end of file From 0239c45d0bf0f81a8c4dcb33dc6ebd92163f42f9 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 22 May 2016 13:13:57 -0700 Subject: [PATCH 32/46] all test for wrapper complete and passing --- lib/TunesTakeoutWrapper.rb | 8 +- .../API/can_add_a_favorite_for_a_user.yml | 903 ++++++++++++++ .../API/can_remove_a_favorite_for_a_user.yml | 1072 +++++++++++++++++ ..._suggestion_info_given_a_suggestion_id.yml | 342 ++---- .../API/can_retrieve_top_20_suggestions.yml | 342 ++---- ...eturn_20_suggestions_after_user_search.yml | 158 +-- ...ggestions_that_include_the_search_term.yml | 911 ++++++++++++++ test/models/TunesTakeoutWrapper_test.rb | 18 +- 8 files changed, 3189 insertions(+), 565 deletions(-) create mode 100644 test/cassettes/TunesTakeoutWrapper/API/can_add_a_favorite_for_a_user.yml create mode 100644 test/cassettes/TunesTakeoutWrapper/API/can_remove_a_favorite_for_a_user.yml create mode 100644 test/cassettes/TunesTakeoutWrapper/API/can_return_suggestions_that_include_the_search_term.yml diff --git a/lib/TunesTakeoutWrapper.rb b/lib/TunesTakeoutWrapper.rb index 7e95cab..ffd8c18 100644 --- a/lib/TunesTakeoutWrapper.rb +++ b/lib/TunesTakeoutWrapper.rb @@ -8,18 +8,16 @@ def self.get_suggestion(suggestion_id) end def self.top_suggestions - # request API to give suggestion ids - data = HTTParty.get(BASE_URL + "/suggestions/top").parsed_response["suggestions"] - # loop through ids, request suggestion data - music id, food id, music type + top_twenty = HTTParty.get(BASE_URL + "/suggestions/top").parsed_response["suggestions"] suggestion_hashes = [] - data.each do |suggestion_id| + top_twenty.each do |suggestion_id| suggestion_hashes << self.get_suggestion(suggestion_id) end return suggestion_hashes end def self.search(term) - data = HTTParty.get(BASE_URL + "/suggestions/search?query=#{term}").parsed_response["suggestions"] + HTTParty.get(BASE_URL + "/suggestions/search?query=#{term}").parsed_response["suggestions"] end def self.add_favorite(uid, suggestion_id) diff --git a/test/cassettes/TunesTakeoutWrapper/API/can_add_a_favorite_for_a_user.yml b/test/cassettes/TunesTakeoutWrapper/API/can_add_a_favorite_for_a_user.yml new file mode 100644 index 0000000..db15f35 --- /dev/null +++ b/test/cassettes/TunesTakeoutWrapper/API/can_add_a_favorite_for_a_user.yml @@ -0,0 +1,903 @@ +--- +http_interactions: +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:36 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '221' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:36 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/top + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:36 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '474' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9Q","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:36 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE- + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:37 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE-","suggestion":{"id":"Vz0KQY-RRwADboE-","food_id":"a-la-mode-pies-seattle","music_id":"1OYLLmDS0pJVFRbUo19vrG","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:37 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:37 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '224' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ","suggestion":{"id":"Vz0KQY-RRwADboEQ","food_id":"old-school-frozen-custard-seattle","music_id":"1hq33mOCO3eLxvgBl0leqP","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:37 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:38 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '221' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:37 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29 + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:38 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '212' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29","suggestion":{"id":"Vz0KNY-RRwADbn29","food_id":"sweet-iron-seattle-2","music_id":"0cOpQTKJdCEzz2wplnnyP6","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:38 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:38 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:38 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:38 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:38 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:39 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '219' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:39 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:39 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:39 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:39 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '226' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:39 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:40 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:40 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:40 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '209' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:40 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:41 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:41 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:41 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '215' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:41 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:41 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:41 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:42 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '228' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I","suggestion":{"id":"Vz0KO4-RRwADbn9I","food_id":"memos-mexican-food-restaurant-seattle","music_id":"4OpGuePj1YVgTIXi2WLHVn","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:42 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:41 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '216' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U","suggestion":{"id":"Vz0KO4-RRwADbn9U","food_id":"malenas-taco-shop-seattle","music_id":"1mFWLJb6bVP4IroYrJVV5R","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:42 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:43 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '223' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x","suggestion":{"id":"Vz0KO4-RRwADbn8x","food_id":"blue-water-taco-grill-seattle-14","music_id":"1pujwuePmCgDFQY32P5elo","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:42 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85 + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:43 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '229' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85","suggestion":{"id":"Vz0KO4-RRwADbn85","food_id":"taqueria-costa-alegre-taco-bus-seattle","music_id":"4QB9QRThl5plfwJmcpFtcp","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:43 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:43 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n","suggestion":{"id":"Vz0KNY-RRwADbn2n","food_id":"crepe-cafe-and-wine-bar-seattle","music_id":"18XycAkvLpkbHoWqGCgIwN","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:43 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:43 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b","suggestion":{"id":"Vz0KO4-RRwADbn9b","food_id":"tacos-chukis-seattle","music_id":"0AyB84D5n6ISyfZMA84NML","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:43 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/search?query=honey + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:49 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '2558' + Via: + - 1.1 vegur + body: + encoding: ASCII-8BIT + string: !binary |- + eyJocmVmIjoiaHR0cHM6Ly90dW5lcy10YWtlb3V0LWFwaS5oZXJva3VhcHAu + Y29tL3YxL3N1Z2dlc3Rpb25zL3NlYXJjaD9xdWVyeT1ob25leVx1MDAyNmxp + bWl0PTIwXHUwMDI2c2VlZD1ob25leSIsInN1Z2dlc3Rpb25zIjpbeyJpZCI6 + IlYwRFpiejJPaEFBRHVTVHkiLCJmb29kX2lkIjoiYnJvb2tmaWVsZC1mYXJt + LWJlZXMtYW5kLWhvbmV5LXNlYXR0bGUiLCJtdXNpY19pZCI6IjE1V29ZYUZh + bkF5bUladWViZnh2T3QiLCJtdXNpY190eXBlIjoidHJhY2sifSx7ImlkIjoi + VjBIc1kxRWxKd0FEekZ1eCIsImZvb2RfaWQiOiJoYXJkd29rLWNhZmUtc2Vh + dHRsZSIsIm11c2ljX2lkIjoiMXNBZkRKNnI3VUpTczZ0emd5bHJKTCIsIm11 + c2ljX3R5cGUiOiJ0cmFjayJ9LHsiaWQiOiJWejBSWFFqTnFBQURCYnM3Iiwi + Zm9vZF9pZCI6ImNhZsOpLXByZXNzZS1zZWF0dGxlLTIiLCJtdXNpY19pZCI6 + IjAwZnRKTTNMQmYxRTV1b0dQZTViejIiLCJtdXNpY190eXBlIjoiYXJ0aXN0 + In0seyJpZCI6IlYwRFpjRDJPaEFBRHVTVDAiLCJmb29kX2lkIjoibGVlcy1h + c2lhbi1yZXN0YXVyYW50LXNlYXR0bGUiLCJtdXNpY19pZCI6IjB5MFFwbWNG + MUczRjc5cmprM2ZqVXgiLCJtdXNpY190eXBlIjoidHJhY2sifSx7ImlkIjoi + VjBEWmNEMk9oQUFEdVNUMSIsImZvb2RfaWQiOiJnZW9yZ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mb29kX2lkIjoiY2hlZi1saWFvLWFzaWFuLWZ1c2lv + bi1jdWlzaW5lLXNlYXR0bGUiLCJtdXNpY19pZCI6IjF0dUlBT1hCU01DcEdO + NFhQc3Zia2ciLCJtdXNpY190eXBlIjoiYXJ0aXN0In0seyJpZCI6IlYwRFpj + RDJPaEFBRHVTVDkiLCJmb29kX2lkIjoianVzLWJhci1zZWF0dGxlIiwibXVz + aWNfaWQiOiIwNmRyNEc2clptbFFiVExBb2U4VzdxIiwibXVzaWNfdHlwZSI6 + ImFydGlzdCJ9LHsiaWQiOiJWMERaY0QyT2hBQUR1U1QtIiwiZm9vZF9pZCI6 + ImthdHN1LWJ1cmdlci1zZWF0dGxlIiwibXVzaWNfaWQiOiIxV1RwNjl6V3Zz + bHdveUJBcklLQVh6IiwibXVzaWNfdHlwZSI6ImFydGlzdCJ9XX0= + http_version: + recorded_at: Sun, 22 May 2016 20:12:49 GMT +- request: + method: post + uri: https://tunes-takeout-api.herokuapp.com/v1/users/testuser1/favorites + body: + encoding: UTF-8 + string: '{"suggestion":"Vz0KO4-RRwADbn9f"}' + headers: + Content-Type: + - application/json + response: + status: + code: 409 + message: Conflict + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:50 GMT + Connection: + - keep-alive + Content-Type: + - text/html;charset=utf-8 + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + Content-Length: + - '0' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Sun, 22 May 2016 20:12:50 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/users/testuser1/favorites + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:50 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '133' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/users/testuser1/favorites","suggestions":["Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9f"]}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:50 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:51 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:50 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:51 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '219' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:51 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/TunesTakeoutWrapper/API/can_remove_a_favorite_for_a_user.yml b/test/cassettes/TunesTakeoutWrapper/API/can_remove_a_favorite_for_a_user.yml new file mode 100644 index 0000000..7e4bbbb --- /dev/null +++ b/test/cassettes/TunesTakeoutWrapper/API/can_remove_a_favorite_for_a_user.yml @@ -0,0 +1,1072 @@ +--- +http_interactions: +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:58 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '221' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:57 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/top + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:57 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '474' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9Q","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:58 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE- + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:58 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE-","suggestion":{"id":"Vz0KQY-RRwADboE-","food_id":"a-la-mode-pies-seattle","music_id":"1OYLLmDS0pJVFRbUo19vrG","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:58 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:59 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '224' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ","suggestion":{"id":"Vz0KQY-RRwADboEQ","food_id":"old-school-frozen-custard-seattle","music_id":"1hq33mOCO3eLxvgBl0leqP","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:59 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:59 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '221' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:59 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:59 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '212' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29","suggestion":{"id":"Vz0KNY-RRwADbn29","food_id":"sweet-iron-seattle-2","music_id":"0cOpQTKJdCEzz2wplnnyP6","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:59 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:00 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:00 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:00 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:00 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:00 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '219' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:00 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:01 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:01 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:01 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '226' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:01 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:01 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:01 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:02 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '209' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:02 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:02 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:02 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:03 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '215' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:03 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:03 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:03 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:03 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '228' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I","suggestion":{"id":"Vz0KO4-RRwADbn9I","food_id":"memos-mexican-food-restaurant-seattle","music_id":"4OpGuePj1YVgTIXi2WLHVn","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:03 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:03 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '216' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U","suggestion":{"id":"Vz0KO4-RRwADbn9U","food_id":"malenas-taco-shop-seattle","music_id":"1mFWLJb6bVP4IroYrJVV5R","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:04 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:04 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '223' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x","suggestion":{"id":"Vz0KO4-RRwADbn8x","food_id":"blue-water-taco-grill-seattle-14","music_id":"1pujwuePmCgDFQY32P5elo","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:04 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:05 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '229' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85","suggestion":{"id":"Vz0KO4-RRwADbn85","food_id":"taqueria-costa-alegre-taco-bus-seattle","music_id":"4QB9QRThl5plfwJmcpFtcp","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:05 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:05 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n","suggestion":{"id":"Vz0KNY-RRwADbn2n","food_id":"crepe-cafe-and-wine-bar-seattle","music_id":"18XycAkvLpkbHoWqGCgIwN","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:05 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:06 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b","suggestion":{"id":"Vz0KO4-RRwADbn9b","food_id":"tacos-chukis-seattle","music_id":"0AyB84D5n6ISyfZMA84NML","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:06 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/search?query=honey + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:13 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '2558' + Via: + - 1.1 vegur + body: + encoding: ASCII-8BIT + string: !binary |- + eyJocmVmIjoiaHR0cHM6Ly90dW5lcy10YWtlb3V0LWFwaS5oZXJva3VhcHAu + Y29tL3YxL3N1Z2dlc3Rpb25zL3NlYXJjaD9xdWVyeT1ob25leVx1MDAyNmxp + bWl0PTIwXHUwMDI2c2VlZD1ob25leSIsInN1Z2dlc3Rpb25zIjpbeyJpZCI6 + IlYwRFpiejJPaEFBRHVTVHkiLCJmb29kX2lkIjoiYnJvb2tmaWVsZC1mYXJt + LWJlZXMtYW5kLWhvbmV5LXNlYXR0bGUiLCJtdXNpY19pZCI6IjE1V29ZYUZh + bkF5bUladWViZnh2T3QiLCJtdXNpY190eXBlIjoidHJhY2sifSx7ImlkIjoi + VjBIc1kxRWxKd0FEekZ1eCIsImZvb2RfaWQiOiJoYXJkd29rLWNhZmUtc2Vh + dHRsZSIsIm11c2ljX2lkIjoiMXNBZkRKNnI3VUpTczZ0emd5bHJKTCIsIm11 + c2ljX3R5cGUiOiJ0cmFjayJ9LHsiaWQiOiJWejBSWFFqTnFBQURCYnM3Iiwi + Zm9vZF9pZCI6ImNhZsOpLXByZXNzZS1zZWF0dGxlLTIiLCJtdXNpY19pZCI6 + IjAwZnRKTTNMQmYxRT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IwQ1hOZFVVaHY1Q3c0MmRyMHdXcmpkIiwibXVzaWNfdHlwZSI6ImFydGlz + dCJ9LHsiaWQiOiJWejBSWGdqTnFBQURCYnRKIiwiZm9vZF9pZCI6ImNhZmbD + qC10b3Jpbm8tc2VhdHRsZS0yIiwibXVzaWNfaWQiOiIxZVlmRW9Od0NJT2w3 + cG0zd3RkNGVFIiwibXVzaWNfdHlwZSI6ImFsYnVtIn0seyJpZCI6IlYwSHNZ + MUVsSndBRHpGdXoiLCJmb29kX2lkIjoiY2hlZi1saWFvLWFzaWFuLWZ1c2lv + bi1jdWlzaW5lLXNlYXR0bGUiLCJtdXNpY19pZCI6IjF0dUlBT1hCU01DcEdO + NFhQc3Zia2ciLCJtdXNpY190eXBlIjoiYXJ0aXN0In0seyJpZCI6IlYwRFpj + RDJPaEFBRHVTVDkiLCJmb29kX2lkIjoianVzLWJhci1zZWF0dGxlIiwibXVz + aWNfaWQiOiIwNmRyNEc2clptbFFiVExBb2U4VzdxIiwibXVzaWNfdHlwZSI6 + ImFydGlzdCJ9LHsiaWQiOiJWMERaY0QyT2hBQUR1U1QtIiwiZm9vZF9pZCI6 + ImthdHN1LWJ1cmdlci1zZWF0dGxlIiwibXVzaWNfaWQiOiIxV1RwNjl6V3Zz + bHdveUJBcklLQVh6IiwibXVzaWNfdHlwZSI6ImFydGlzdCJ9XX0= + http_version: + recorded_at: Sun, 22 May 2016 20:12:15 GMT +- request: + method: post + uri: https://tunes-takeout-api.herokuapp.com/v1/users/testuser2/favorites + body: + encoding: UTF-8 + string: '{"suggestion":"Vz0KO4-RRwADbn9c"}' + headers: + Content-Type: + - application/json + response: + status: + code: 201 + message: Created + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:15 GMT + Connection: + - keep-alive + Content-Type: + - text/html;charset=utf-8 + X-Xss-Protection: + - 1; mode=block + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + Content-Length: + - '0' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Sun, 22 May 2016 20:12:15 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/users/testuser2/favorites + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:15 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '114' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/users/testuser2/favorites","suggestions":["Vz0KO4-RRwADbn9c"]}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:15 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:16 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:16 GMT +- request: + method: delete + uri: https://tunes-takeout-api.herokuapp.com/v1/users/testuser2/favorites + body: + encoding: UTF-8 + string: '{"suggestion":"Vz0KO4-RRwADbn9c"}' + headers: + Content-Type: + - application/json + response: + status: + code: 204 + message: No Content + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:16 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '' + http_version: + recorded_at: Sun, 22 May 2016 20:12:16 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/users/testuser2/favorites + body: + encoding: US-ASCII + string: '' + headers: {} + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:12:17 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '96' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/users/testuser2/favorites","suggestions":[]}' + http_version: + recorded_at: Sun, 22 May 2016 20:12:17 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_a_hash_of_suggestion_info_given_a_suggestion_id.yml b/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_a_hash_of_suggestion_info_given_a_suggestion_id.yml index c8a4e56..29eb974 100644 --- a/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_a_hash_of_suggestion_info_given_a_suggestion_id.yml +++ b/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_a_hash_of_suggestion_info_given_a_suggestion_id.yml @@ -2,17 +2,11 @@ http_interactions: - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -21,7 +15,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:06 GMT + - Sun, 22 May 2016 20:12:51 GMT Connection: - keep-alive Content-Type: @@ -29,27 +23,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '213' + - '221' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:07 GMT + recorded_at: Sun, 22 May 2016 20:12:51 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/top body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -58,7 +46,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:07 GMT + - Sun, 22 May 2016 20:12:51 GMT Connection: - keep-alive Content-Type: @@ -71,22 +59,16 @@ http_interactions: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9Q","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9Q","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' http_version: - recorded_at: Sun, 22 May 2016 18:47:07 GMT + recorded_at: Sun, 22 May 2016 20:12:51 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE- body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -95,7 +77,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:07 GMT + - Sun, 22 May 2016 20:12:51 GMT Connection: - keep-alive Content-Type: @@ -110,20 +92,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE-","suggestion":{"id":"Vz0KQY-RRwADboE-","food_id":"a-la-mode-pies-seattle","music_id":"1OYLLmDS0pJVFRbUo19vrG","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:07 GMT + recorded_at: Sun, 22 May 2016 20:12:52 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -132,7 +108,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:07 GMT + - Sun, 22 May 2016 20:12:53 GMT Connection: - keep-alive Content-Type: @@ -147,20 +123,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ","suggestion":{"id":"Vz0KQY-RRwADboEQ","food_id":"old-school-frozen-custard-seattle","music_id":"1hq33mOCO3eLxvgBl0leqP","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:08 GMT + recorded_at: Sun, 22 May 2016 20:12:53 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -169,7 +139,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:08 GMT + - Sun, 22 May 2016 20:12:53 GMT Connection: - keep-alive Content-Type: @@ -184,20 +154,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:08 GMT + recorded_at: Sun, 22 May 2016 20:12:53 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29 body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -206,7 +170,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:09 GMT + - Sun, 22 May 2016 20:12:53 GMT Connection: - keep-alive Content-Type: @@ -221,20 +185,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29","suggestion":{"id":"Vz0KNY-RRwADbn29","food_id":"sweet-iron-seattle-2","music_id":"0cOpQTKJdCEzz2wplnnyP6","music_type":"artist"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:09 GMT + recorded_at: Sun, 22 May 2016 20:12:53 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -243,7 +201,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:09 GMT + - Sun, 22 May 2016 20:12:53 GMT Connection: - keep-alive Content-Type: @@ -256,22 +214,16 @@ http_interactions: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:09 GMT + recorded_at: Sun, 22 May 2016 20:12:54 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -280,7 +232,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:09 GMT + - Sun, 22 May 2016 20:12:54 GMT Connection: - keep-alive Content-Type: @@ -288,27 +240,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '217' + - '213' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:09 GMT + recorded_at: Sun, 22 May 2016 20:12:54 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -317,7 +263,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:09 GMT + - Sun, 22 May 2016 20:12:54 GMT Connection: - keep-alive Content-Type: @@ -325,27 +271,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '226' + - '219' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:10 GMT + recorded_at: Sun, 22 May 2016 20:12:54 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -354,7 +294,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:10 GMT + - Sun, 22 May 2016 20:12:55 GMT Connection: - keep-alive Content-Type: @@ -362,27 +302,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '219' + - '217' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:10 GMT + recorded_at: Sun, 22 May 2016 20:12:55 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -391,7 +325,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:10 GMT + - Sun, 22 May 2016 20:12:55 GMT Connection: - keep-alive Content-Type: @@ -399,27 +333,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '222' + - '226' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:11 GMT + recorded_at: Sun, 22 May 2016 20:12:55 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -428,7 +356,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:11 GMT + - Sun, 22 May 2016 20:12:55 GMT Connection: - keep-alive Content-Type: @@ -436,27 +364,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '209' + - '222' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:11 GMT + recorded_at: Sun, 22 May 2016 20:12:55 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -465,7 +387,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:11 GMT + - Sun, 22 May 2016 20:12:56 GMT Connection: - keep-alive Content-Type: @@ -473,27 +395,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '217' + - '209' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:11 GMT + recorded_at: Sun, 22 May 2016 20:12:56 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -502,7 +418,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:11 GMT + - Sun, 22 May 2016 20:12:56 GMT Connection: - keep-alive Content-Type: @@ -510,27 +426,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '215' + - '217' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:12 GMT + recorded_at: Sun, 22 May 2016 20:12:56 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -539,7 +449,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:12 GMT + - Sun, 22 May 2016 20:12:56 GMT Connection: - keep-alive Content-Type: @@ -547,27 +457,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '211' + - '215' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:12 GMT + recorded_at: Sun, 22 May 2016 20:12:57 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -576,7 +480,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:12 GMT + - Sun, 22 May 2016 20:12:56 GMT Connection: - keep-alive Content-Type: @@ -584,27 +488,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '213' + - '211' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:13 GMT + recorded_at: Sun, 22 May 2016 20:12:57 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -613,7 +511,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:13 GMT + - Sun, 22 May 2016 20:12:57 GMT Connection: - keep-alive Content-Type: @@ -628,20 +526,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I","suggestion":{"id":"Vz0KO4-RRwADbn9I","food_id":"memos-mexican-food-restaurant-seattle","music_id":"4OpGuePj1YVgTIXi2WLHVn","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:13 GMT + recorded_at: Sun, 22 May 2016 20:12:57 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -650,7 +542,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:13 GMT + - Sun, 22 May 2016 20:12:58 GMT Connection: - keep-alive Content-Type: @@ -665,20 +557,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U","suggestion":{"id":"Vz0KO4-RRwADbn9U","food_id":"malenas-taco-shop-seattle","music_id":"1mFWLJb6bVP4IroYrJVV5R","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:13 GMT + recorded_at: Sun, 22 May 2016 20:12:58 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -687,7 +573,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:13 GMT + - Sun, 22 May 2016 20:12:58 GMT Connection: - keep-alive Content-Type: @@ -702,20 +588,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x","suggestion":{"id":"Vz0KO4-RRwADbn8x","food_id":"blue-water-taco-grill-seattle-14","music_id":"1pujwuePmCgDFQY32P5elo","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:14 GMT + recorded_at: Sun, 22 May 2016 20:12:58 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85 body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -724,7 +604,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:14 GMT + - Sun, 22 May 2016 20:12:58 GMT Connection: - keep-alive Content-Type: @@ -739,20 +619,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85","suggestion":{"id":"Vz0KO4-RRwADbn85","food_id":"taqueria-costa-alegre-taco-bus-seattle","music_id":"4QB9QRThl5plfwJmcpFtcp","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:14 GMT + recorded_at: Sun, 22 May 2016 20:12:58 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -761,7 +635,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:14 GMT + - Sun, 22 May 2016 20:12:59 GMT Connection: - keep-alive Content-Type: @@ -776,20 +650,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n","suggestion":{"id":"Vz0KNY-RRwADbn2n","food_id":"crepe-cafe-and-wine-bar-seattle","music_id":"18XycAkvLpkbHoWqGCgIwN","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:15 GMT + recorded_at: Sun, 22 May 2016 20:12:59 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -798,7 +666,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:15 GMT + - Sun, 22 May 2016 20:12:59 GMT Connection: - keep-alive Content-Type: @@ -813,20 +681,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b","suggestion":{"id":"Vz0KO4-RRwADbn9b","food_id":"tacos-chukis-seattle","music_id":"0AyB84D5n6ISyfZMA84NML","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:15 GMT + recorded_at: Sun, 22 May 2016 20:12:59 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/search?query=honey body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -835,7 +697,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:21 GMT + - Sun, 22 May 2016 20:13:05 GMT Connection: - keep-alive Content-Type: @@ -907,5 +769,5 @@ http_interactions: ImthdHN1LWJ1cmdlci1zZWF0dGxlIiwibXVzaWNfaWQiOiIxV1RwNjl6V3Zz bHdveUJBcklLQVh6IiwibXVzaWNfdHlwZSI6ImFydGlzdCJ9XX0= http_version: - recorded_at: Sun, 22 May 2016 18:47:21 GMT + recorded_at: Sun, 22 May 2016 20:13:06 GMT recorded_with: VCR 3.0.2 diff --git a/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_top_20_suggestions.yml b/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_top_20_suggestions.yml index 9d3e711..22a30b3 100644 --- a/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_top_20_suggestions.yml +++ b/test/cassettes/TunesTakeoutWrapper/API/can_retrieve_top_20_suggestions.yml @@ -2,17 +2,11 @@ http_interactions: - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -21,7 +15,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:37 GMT + - Sun, 22 May 2016 20:12:17 GMT Connection: - keep-alive Content-Type: @@ -29,27 +23,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '213' + - '221' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:37 GMT + recorded_at: Sun, 22 May 2016 20:12:17 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/top body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -58,7 +46,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:38 GMT + - Sun, 22 May 2016 20:12:17 GMT Connection: - keep-alive Content-Type: @@ -71,22 +59,16 @@ http_interactions: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9Q","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9Q","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' http_version: - recorded_at: Sun, 22 May 2016 18:47:37 GMT + recorded_at: Sun, 22 May 2016 20:12:17 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE- body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -95,7 +77,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:38 GMT + - Sun, 22 May 2016 20:12:18 GMT Connection: - keep-alive Content-Type: @@ -110,20 +92,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE-","suggestion":{"id":"Vz0KQY-RRwADboE-","food_id":"a-la-mode-pies-seattle","music_id":"1OYLLmDS0pJVFRbUo19vrG","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:38 GMT + recorded_at: Sun, 22 May 2016 20:12:18 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -132,7 +108,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:38 GMT + - Sun, 22 May 2016 20:12:18 GMT Connection: - keep-alive Content-Type: @@ -147,20 +123,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ","suggestion":{"id":"Vz0KQY-RRwADboEQ","food_id":"old-school-frozen-custard-seattle","music_id":"1hq33mOCO3eLxvgBl0leqP","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:38 GMT + recorded_at: Sun, 22 May 2016 20:12:18 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -169,7 +139,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:39 GMT + - Sun, 22 May 2016 20:12:19 GMT Connection: - keep-alive Content-Type: @@ -184,20 +154,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:39 GMT + recorded_at: Sun, 22 May 2016 20:12:19 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29 body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -206,7 +170,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:39 GMT + - Sun, 22 May 2016 20:12:19 GMT Connection: - keep-alive Content-Type: @@ -221,20 +185,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29","suggestion":{"id":"Vz0KNY-RRwADbn29","food_id":"sweet-iron-seattle-2","music_id":"0cOpQTKJdCEzz2wplnnyP6","music_type":"artist"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:39 GMT + recorded_at: Sun, 22 May 2016 20:12:19 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -243,7 +201,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:39 GMT + - Sun, 22 May 2016 20:12:19 GMT Connection: - keep-alive Content-Type: @@ -256,22 +214,16 @@ http_interactions: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:39 GMT + recorded_at: Sun, 22 May 2016 20:12:19 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -280,7 +232,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:40 GMT + - Sun, 22 May 2016 20:12:20 GMT Connection: - keep-alive Content-Type: @@ -288,27 +240,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '217' + - '213' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:40 GMT + recorded_at: Sun, 22 May 2016 20:12:20 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -317,7 +263,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:41 GMT + - Sun, 22 May 2016 20:12:21 GMT Connection: - keep-alive Content-Type: @@ -325,27 +271,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '226' + - '219' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:40 GMT + recorded_at: Sun, 22 May 2016 20:12:20 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -354,7 +294,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:41 GMT + - Sun, 22 May 2016 20:12:21 GMT Connection: - keep-alive Content-Type: @@ -362,27 +302,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '219' + - '217' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:41 GMT + recorded_at: Sun, 22 May 2016 20:12:21 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -391,7 +325,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:42 GMT + - Sun, 22 May 2016 20:12:21 GMT Connection: - keep-alive Content-Type: @@ -399,27 +333,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '222' + - '226' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:41 GMT + recorded_at: Sun, 22 May 2016 20:12:21 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -428,7 +356,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:41 GMT + - Sun, 22 May 2016 20:12:22 GMT Connection: - keep-alive Content-Type: @@ -436,27 +364,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '209' + - '222' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:42 GMT + recorded_at: Sun, 22 May 2016 20:12:22 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -465,7 +387,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:42 GMT + - Sun, 22 May 2016 20:12:22 GMT Connection: - keep-alive Content-Type: @@ -473,27 +395,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '217' + - '209' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:42 GMT + recorded_at: Sun, 22 May 2016 20:12:22 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -502,7 +418,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:42 GMT + - Sun, 22 May 2016 20:12:23 GMT Connection: - keep-alive Content-Type: @@ -510,27 +426,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '215' + - '217' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:42 GMT + recorded_at: Sun, 22 May 2016 20:12:23 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -539,7 +449,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:42 GMT + - Sun, 22 May 2016 20:12:23 GMT Connection: - keep-alive Content-Type: @@ -547,27 +457,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '211' + - '215' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:43 GMT + recorded_at: Sun, 22 May 2016 20:12:23 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -576,7 +480,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:43 GMT + - Sun, 22 May 2016 20:12:23 GMT Connection: - keep-alive Content-Type: @@ -584,27 +488,21 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '213' + - '211' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:43 GMT + recorded_at: Sun, 22 May 2016 20:12:23 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -613,7 +511,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:44 GMT + - Sun, 22 May 2016 20:12:24 GMT Connection: - keep-alive Content-Type: @@ -628,20 +526,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I","suggestion":{"id":"Vz0KO4-RRwADbn9I","food_id":"memos-mexican-food-restaurant-seattle","music_id":"4OpGuePj1YVgTIXi2WLHVn","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:43 GMT + recorded_at: Sun, 22 May 2016 20:12:24 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -650,7 +542,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:44 GMT + - Sun, 22 May 2016 20:12:24 GMT Connection: - keep-alive Content-Type: @@ -665,20 +557,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U","suggestion":{"id":"Vz0KO4-RRwADbn9U","food_id":"malenas-taco-shop-seattle","music_id":"1mFWLJb6bVP4IroYrJVV5R","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:44 GMT + recorded_at: Sun, 22 May 2016 20:12:24 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -687,7 +573,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:44 GMT + - Sun, 22 May 2016 20:12:25 GMT Connection: - keep-alive Content-Type: @@ -702,20 +588,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x","suggestion":{"id":"Vz0KO4-RRwADbn8x","food_id":"blue-water-taco-grill-seattle-14","music_id":"1pujwuePmCgDFQY32P5elo","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:44 GMT + recorded_at: Sun, 22 May 2016 20:12:24 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85 body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -724,7 +604,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:44 GMT + - Sun, 22 May 2016 20:12:25 GMT Connection: - keep-alive Content-Type: @@ -739,20 +619,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85","suggestion":{"id":"Vz0KO4-RRwADbn85","food_id":"taqueria-costa-alegre-taco-bus-seattle","music_id":"4QB9QRThl5plfwJmcpFtcp","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:45 GMT + recorded_at: Sun, 22 May 2016 20:12:25 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -761,7 +635,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:44 GMT + - Sun, 22 May 2016 20:12:26 GMT Connection: - keep-alive Content-Type: @@ -776,20 +650,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n","suggestion":{"id":"Vz0KNY-RRwADbn2n","food_id":"crepe-cafe-and-wine-bar-seattle","music_id":"18XycAkvLpkbHoWqGCgIwN","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:45 GMT + recorded_at: Sun, 22 May 2016 20:12:25 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -798,7 +666,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:45 GMT + - Sun, 22 May 2016 20:12:25 GMT Connection: - keep-alive Content-Type: @@ -813,20 +681,14 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b","suggestion":{"id":"Vz0KO4-RRwADbn9b","food_id":"tacos-chukis-seattle","music_id":"0AyB84D5n6ISyfZMA84NML","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:45 GMT + recorded_at: Sun, 22 May 2016 20:12:26 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/search?query=honey body: encoding: US-ASCII string: '' - headers: - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - Ruby + headers: {} response: status: code: 200 @@ -835,7 +697,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:51 GMT + - Sun, 22 May 2016 20:12:33 GMT Connection: - keep-alive Content-Type: @@ -907,5 +769,5 @@ http_interactions: ImthdHN1LWJ1cmdlci1zZWF0dGxlIiwibXVzaWNfaWQiOiIxV1RwNjl6V3Zz bHdveUJBcklLQVh6IiwibXVzaWNfdHlwZSI6ImFydGlzdCJ9XX0= http_version: - recorded_at: Sun, 22 May 2016 18:47:51 GMT + recorded_at: Sun, 22 May 2016 20:12:35 GMT recorded_with: VCR 3.0.2 diff --git a/test/cassettes/TunesTakeoutWrapper/API/can_return_20_suggestions_after_user_search.yml b/test/cassettes/TunesTakeoutWrapper/API/can_return_20_suggestions_after_user_search.yml index 5e4be1e..ff8a165 100644 --- a/test/cassettes/TunesTakeoutWrapper/API/can_return_20_suggestions_after_user_search.yml +++ b/test/cassettes/TunesTakeoutWrapper/API/can_return_20_suggestions_after_user_search.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t body: encoding: US-ASCII string: '' @@ -21,7 +21,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:22 GMT + - Sun, 22 May 2016 20:11:28 GMT Connection: - keep-alive Content-Type: @@ -29,14 +29,14 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '213' + - '221' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:21 GMT + recorded_at: Sun, 22 May 2016 20:11:29 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/top @@ -58,7 +58,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:21 GMT + - Sun, 22 May 2016 20:11:29 GMT Connection: - keep-alive Content-Type: @@ -71,9 +71,9 @@ http_interactions: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9Q","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9Q","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' http_version: - recorded_at: Sun, 22 May 2016 18:47:22 GMT + recorded_at: Sun, 22 May 2016 20:11:29 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE- @@ -95,7 +95,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:22 GMT + - Sun, 22 May 2016 20:11:30 GMT Connection: - keep-alive Content-Type: @@ -110,7 +110,7 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE-","suggestion":{"id":"Vz0KQY-RRwADboE-","food_id":"a-la-mode-pies-seattle","music_id":"1OYLLmDS0pJVFRbUo19vrG","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:22 GMT + recorded_at: Sun, 22 May 2016 20:11:29 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ @@ -132,7 +132,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:22 GMT + - Sun, 22 May 2016 20:11:30 GMT Connection: - keep-alive Content-Type: @@ -147,7 +147,7 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ","suggestion":{"id":"Vz0KQY-RRwADboEQ","food_id":"old-school-frozen-custard-seattle","music_id":"1hq33mOCO3eLxvgBl0leqP","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:22 GMT + recorded_at: Sun, 22 May 2016 20:11:30 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t @@ -169,7 +169,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:23 GMT + - Sun, 22 May 2016 20:11:29 GMT Connection: - keep-alive Content-Type: @@ -184,7 +184,7 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:23 GMT + recorded_at: Sun, 22 May 2016 20:11:30 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29 @@ -206,7 +206,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:23 GMT + - Sun, 22 May 2016 20:11:30 GMT Connection: - keep-alive Content-Type: @@ -221,10 +221,10 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29","suggestion":{"id":"Vz0KNY-RRwADbn29","food_id":"sweet-iron-seattle-2","music_id":"0cOpQTKJdCEzz2wplnnyP6","music_type":"artist"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:23 GMT + recorded_at: Sun, 22 May 2016 20:11:30 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c body: encoding: US-ASCII string: '' @@ -243,7 +243,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:23 GMT + - Sun, 22 May 2016 20:11:30 GMT Connection: - keep-alive Content-Type: @@ -256,12 +256,12 @@ http_interactions: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:24 GMT + recorded_at: Sun, 22 May 2016 20:11:31 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q body: encoding: US-ASCII string: '' @@ -280,7 +280,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:23 GMT + - Sun, 22 May 2016 20:11:31 GMT Connection: - keep-alive Content-Type: @@ -288,17 +288,17 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '217' + - '213' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:24 GMT + recorded_at: Sun, 22 May 2016 20:11:31 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f body: encoding: US-ASCII string: '' @@ -317,7 +317,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:24 GMT + - Sun, 22 May 2016 20:11:31 GMT Connection: - keep-alive Content-Type: @@ -325,17 +325,17 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '226' + - '219' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:24 GMT + recorded_at: Sun, 22 May 2016 20:11:31 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP body: encoding: US-ASCII string: '' @@ -354,7 +354,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:25 GMT + - Sun, 22 May 2016 20:11:32 GMT Connection: - keep-alive Content-Type: @@ -362,17 +362,17 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '219' + - '217' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:25 GMT + recorded_at: Sun, 22 May 2016 20:11:32 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN body: encoding: US-ASCII string: '' @@ -391,7 +391,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:25 GMT + - Sun, 22 May 2016 20:11:32 GMT Connection: - keep-alive Content-Type: @@ -399,17 +399,17 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '222' + - '226' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:25 GMT + recorded_at: Sun, 22 May 2016 20:11:32 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq body: encoding: US-ASCII string: '' @@ -428,7 +428,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:25 GMT + - Sun, 22 May 2016 20:11:33 GMT Connection: - keep-alive Content-Type: @@ -436,17 +436,17 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '209' + - '222' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:25 GMT + recorded_at: Sun, 22 May 2016 20:11:33 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d body: encoding: US-ASCII string: '' @@ -465,7 +465,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:25 GMT + - Sun, 22 May 2016 20:11:33 GMT Connection: - keep-alive Content-Type: @@ -473,17 +473,17 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '217' + - '209' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:26 GMT + recorded_at: Sun, 22 May 2016 20:11:33 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V body: encoding: US-ASCII string: '' @@ -502,7 +502,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:26 GMT + - Sun, 22 May 2016 20:11:33 GMT Connection: - keep-alive Content-Type: @@ -510,17 +510,17 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '215' + - '217' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:26 GMT + recorded_at: Sun, 22 May 2016 20:11:33 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z body: encoding: US-ASCII string: '' @@ -539,7 +539,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:26 GMT + - Sun, 22 May 2016 20:11:33 GMT Connection: - keep-alive Content-Type: @@ -547,17 +547,17 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '211' + - '215' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:26 GMT + recorded_at: Sun, 22 May 2016 20:11:34 GMT - request: method: get - uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x body: encoding: US-ASCII string: '' @@ -576,7 +576,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:26 GMT + - Sun, 22 May 2016 20:11:34 GMT Connection: - keep-alive Content-Type: @@ -584,14 +584,14 @@ http_interactions: X-Content-Type-Options: - nosniff Content-Length: - - '213' + - '211' Via: - 1.1 vegur body: encoding: UTF-8 - string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:27 GMT + recorded_at: Sun, 22 May 2016 20:11:34 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I @@ -613,7 +613,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:27 GMT + - Sun, 22 May 2016 20:11:34 GMT Connection: - keep-alive Content-Type: @@ -628,7 +628,7 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I","suggestion":{"id":"Vz0KO4-RRwADbn9I","food_id":"memos-mexican-food-restaurant-seattle","music_id":"4OpGuePj1YVgTIXi2WLHVn","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:27 GMT + recorded_at: Sun, 22 May 2016 20:11:34 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U @@ -650,7 +650,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:27 GMT + - Sun, 22 May 2016 20:11:35 GMT Connection: - keep-alive Content-Type: @@ -665,7 +665,7 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U","suggestion":{"id":"Vz0KO4-RRwADbn9U","food_id":"malenas-taco-shop-seattle","music_id":"1mFWLJb6bVP4IroYrJVV5R","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:28 GMT + recorded_at: Sun, 22 May 2016 20:11:35 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x @@ -687,7 +687,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:28 GMT + - Sun, 22 May 2016 20:11:35 GMT Connection: - keep-alive Content-Type: @@ -702,7 +702,7 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x","suggestion":{"id":"Vz0KO4-RRwADbn8x","food_id":"blue-water-taco-grill-seattle-14","music_id":"1pujwuePmCgDFQY32P5elo","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:28 GMT + recorded_at: Sun, 22 May 2016 20:11:35 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85 @@ -724,7 +724,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:29 GMT + - Sun, 22 May 2016 20:11:35 GMT Connection: - keep-alive Content-Type: @@ -739,7 +739,7 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85","suggestion":{"id":"Vz0KO4-RRwADbn85","food_id":"taqueria-costa-alegre-taco-bus-seattle","music_id":"4QB9QRThl5plfwJmcpFtcp","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:28 GMT + recorded_at: Sun, 22 May 2016 20:11:36 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n @@ -761,7 +761,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:28 GMT + - Sun, 22 May 2016 20:11:36 GMT Connection: - keep-alive Content-Type: @@ -776,7 +776,7 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n","suggestion":{"id":"Vz0KNY-RRwADbn2n","food_id":"crepe-cafe-and-wine-bar-seattle","music_id":"18XycAkvLpkbHoWqGCgIwN","music_type":"track"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:29 GMT + recorded_at: Sun, 22 May 2016 20:11:36 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b @@ -798,7 +798,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:30 GMT + - Sun, 22 May 2016 20:11:36 GMT Connection: - keep-alive Content-Type: @@ -813,7 +813,7 @@ http_interactions: encoding: UTF-8 string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b","suggestion":{"id":"Vz0KO4-RRwADbn9b","food_id":"tacos-chukis-seattle","music_id":"0AyB84D5n6ISyfZMA84NML","music_type":"album"}}' http_version: - recorded_at: Sun, 22 May 2016 18:47:29 GMT + recorded_at: Sun, 22 May 2016 20:11:36 GMT - request: method: get uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/search?query=honey @@ -835,7 +835,7 @@ http_interactions: Server: - Cowboy Date: - - Sun, 22 May 2016 18:47:36 GMT + - Sun, 22 May 2016 20:11:42 GMT Connection: - keep-alive Content-Type: @@ -907,5 +907,5 @@ http_interactions: ImthdHN1LWJ1cmdlci1zZWF0dGxlIiwibXVzaWNfaWQiOiIxV1RwNjl6V3Zz bHdveUJBcklLQVh6IiwibXVzaWNfdHlwZSI6ImFydGlzdCJ9XX0= http_version: - recorded_at: Sun, 22 May 2016 18:47:36 GMT + recorded_at: Sun, 22 May 2016 20:11:42 GMT recorded_with: VCR 3.0.2 diff --git a/test/cassettes/TunesTakeoutWrapper/API/can_return_suggestions_that_include_the_search_term.yml b/test/cassettes/TunesTakeoutWrapper/API/can_return_suggestions_that_include_the_search_term.yml new file mode 100644 index 0000000..a28649a --- /dev/null +++ b/test/cassettes/TunesTakeoutWrapper/API/can_return_suggestions_that_include_the_search_term.yml @@ -0,0 +1,911 @@ +--- +http_interactions: +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:42 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '221' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:42 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/top + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:42 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '474' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/top?limit=20","suggestions":["Vz0KQY-RRwADboE-","Vz0KQY-RRwADboEQ","Vz0KO4-RRwADbn9t","Vz0KNY-RRwADbn29","Vz0KO4-RRwADbn9c","Vz0KO4-RRwADbn9Q","Vz0KO4-RRwADbn9f","Vz0KQY-RRwADboFP","Vz0KQY-RRwADboFN","Vz0KQY-RRwADboEq","Vz0KO4-RRwADbn9d","Vz0KO4-RRwADbn9V","Vz0KO4-RRwADbn8Z","Vz0KO4-RRwADbn9x","Vz0KO4-RRwADbn9I","Vz0KO4-RRwADbn9U","Vz0KO4-RRwADbn8x","Vz0KO4-RRwADbn85","Vz0KNY-RRwADbn2n","Vz0KO4-RRwADbn9b"]}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:42 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE- + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:43 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboE-","suggestion":{"id":"Vz0KQY-RRwADboE-","food_id":"a-la-mode-pies-seattle","music_id":"1OYLLmDS0pJVFRbUo19vrG","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:43 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:44 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '224' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEQ","suggestion":{"id":"Vz0KQY-RRwADboEQ","food_id":"old-school-frozen-custard-seattle","music_id":"1hq33mOCO3eLxvgBl0leqP","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:43 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:43 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '221' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9t","suggestion":{"id":"Vz0KO4-RRwADbn9t","food_id":"taqueria-la-pasadita-seattle-3","music_id":"0jEsVskTgxfybttvO9gnLK","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:44 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:44 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '212' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn29","suggestion":{"id":"Vz0KNY-RRwADbn29","food_id":"sweet-iron-seattle-2","music_id":"0cOpQTKJdCEzz2wplnnyP6","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:44 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:44 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9c","suggestion":{"id":"Vz0KO4-RRwADbn9c","food_id":"el-taco-loco-seattle-2","music_id":"0qO38KC2CGDmNSOAb2rpzj","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:44 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:45 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '213' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9Q","suggestion":{"id":"Vz0KO4-RRwADbn9Q","food_id":"nacho-borracho-seattle","music_id":"4DWLyse4wDNthzOYvFZQfi","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:45 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:45 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '219' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9f","suggestion":{"id":"Vz0KO4-RRwADbn9f","food_id":"cactus-restaurants-seattle-2","music_id":"20OmjCaPoZZg3hQ9iOKmrq","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:45 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:45 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFP","suggestion":{"id":"Vz0KQY-RRwADboFP","food_id":"piroshky-piroshky-seattle","music_id":"13kFHFPF8dWNyK2yvgXf3S","music_type":"artist"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:45 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:46 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '226' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboFN","suggestion":{"id":"Vz0KQY-RRwADboFN","food_id":"emerald-city-fish-and-chips-seattle","music_id":"18nhNX9AEFPINp1txOsaJS","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:46 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:46 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KQY-RRwADboEq","suggestion":{"id":"Vz0KQY-RRwADboEq","food_id":"le-panier-french-bakery-seattle","music_id":"1YPtiR8vL7n29XpP0dTmGc","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:46 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:46 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '209' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9d","suggestion":{"id":"Vz0KO4-RRwADbn9d","food_id":"el-cabrito-seattle","music_id":"2rV6X8xj2EmDURLce7ZH0Y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:47 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:47 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '217' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9V","suggestion":{"id":"Vz0KO4-RRwADbn9V","food_id":"taqueria-el-antojo-seattle","music_id":"3i3f6NmMLCwSOn0rwzKa8y","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:47 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:48 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '215' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8Z","suggestion":{"id":"Vz0KO4-RRwADbn8Z","food_id":"bebas-and-amigos-seattle","music_id":"2IO61W1ZRIwpWUXiO6AAxJ","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:47 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:48 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9x","suggestion":{"id":"Vz0KO4-RRwADbn9x","food_id":"el-camion-seattle-13","music_id":"28CkJzoE5LBWJpzQr5g0f4","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:48 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:48 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '228' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9I","suggestion":{"id":"Vz0KO4-RRwADbn9I","food_id":"memos-mexican-food-restaurant-seattle","music_id":"4OpGuePj1YVgTIXi2WLHVn","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:48 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:49 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '216' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9U","suggestion":{"id":"Vz0KO4-RRwADbn9U","food_id":"malenas-taco-shop-seattle","music_id":"1mFWLJb6bVP4IroYrJVV5R","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:48 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:49 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '223' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn8x","suggestion":{"id":"Vz0KO4-RRwADbn8x","food_id":"blue-water-taco-grill-seattle-14","music_id":"1pujwuePmCgDFQY32P5elo","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:49 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:49 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '229' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn85","suggestion":{"id":"Vz0KO4-RRwADbn85","food_id":"taqueria-costa-alegre-taco-bus-seattle","music_id":"4QB9QRThl5plfwJmcpFtcp","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:49 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:49 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '222' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KNY-RRwADbn2n","suggestion":{"id":"Vz0KNY-RRwADbn2n","food_id":"crepe-cafe-and-wine-bar-seattle","music_id":"18XycAkvLpkbHoWqGCgIwN","music_type":"track"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:50 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:50 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '211' + Via: + - 1.1 vegur + body: + encoding: UTF-8 + string: '{"href":"https://tunes-takeout-api.herokuapp.com/v1/suggestions/Vz0KO4-RRwADbn9b","suggestion":{"id":"Vz0KO4-RRwADbn9b","food_id":"tacos-chukis-seattle","music_id":"0AyB84D5n6ISyfZMA84NML","music_type":"album"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:11:50 GMT +- request: + method: get + uri: https://tunes-takeout-api.herokuapp.com/v1/suggestions/search?query=honey + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - Cowboy + Date: + - Sun, 22 May 2016 20:11:57 GMT + Connection: + - keep-alive + Content-Type: + - application/json + X-Content-Type-Options: + - nosniff + Content-Length: + - '2558' + Via: + - 1.1 vegur + body: + encoding: ASCII-8BIT + string: !binary |- + eyJocmVmIjoiaHR0cHM6Ly90dW5lcy10YWtlb3V0LWFwaS5oZXJva3VhcHAu + Y29tL3YxL3N1Z2dlc3Rpb25zL3NlYXJjaD9xdWVyeT1ob25leVx1MDAyNmxp + bWl0PTIwXHUwMDI2c2VlZD1ob25leSIsInN1Z2dlc3Rpb25zIjpbeyJpZCI6 +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ImthdHN1LWJ1cmdlci1zZWF0dGxlIiwibXVzaWNfaWQiOiIxV1RwNjl6V3Zz + bHdveUJBcklLQVh6IiwibXVzaWNfdHlwZSI6ImFydGlzdCJ9XX0= + http_version: + recorded_at: Sun, 22 May 2016 20:11:57 GMT +recorded_with: VCR 3.0.2 diff --git a/test/models/TunesTakeoutWrapper_test.rb b/test/models/TunesTakeoutWrapper_test.rb index 4fc2042..3f416f9 100644 --- a/test/models/TunesTakeoutWrapper_test.rb +++ b/test/models/TunesTakeoutWrapper_test.rb @@ -11,7 +11,7 @@ class TunesTakeoutWrapperTest < ActiveSupport::TestCase describe "API", :vcr do before do - @suggestion_id = TunesTakeoutWrapper.get_suggestion("Vz0KO4-RRwADbn9c") + @suggestion_id = TunesTakeoutWrapper.get_suggestion("Vz0KO4-RRwADbn9t") @top_suggestions = TunesTakeoutWrapper.top_suggestions @search = TunesTakeoutWrapper.search("honey") end @@ -28,9 +28,25 @@ class TunesTakeoutWrapperTest < ActiveSupport::TestCase assert_equal 20, @search.length end + it "can return suggestions that include the search term", :vcr do + assert true, @search.include?("honey") + end + + it "can add a favorite for a user", :vcr do + TunesTakeoutWrapper.add_favorite("testuser1", "Vz0KO4-RRwADbn9f") + favorites = TunesTakeoutWrapper.user_favorites("testuser1") + assert true, favorites.include?("Vz0KO4-RRwADbn9f") + end + it "can remove a favorite for a user", :vcr do + TunesTakeoutWrapper.add_favorite("testuser2", "Vz0KO4-RRwADbn9c") + first_favorites = TunesTakeoutWrapper.user_favorites("testuser2").count + TunesTakeoutWrapper.delete_favorite("testuser2", "Vz0KO4-RRwADbn9c") + second_favorites = TunesTakeoutWrapper.user_favorites("testuser2").count + assert_equal second_favorites, (first_favorites - 1) + end end From f8d5f0cc75accfcdd17c21c494ee52ce61664ecd Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 22 May 2016 13:56:12 -0700 Subject: [PATCH 33/46] food model test complete including test for yelp api call --- ..._find_a_business_on_yelp_using_food_id.yml | 91 +++++++++++++++++++ test/models/TunesTakeoutWrapper_test.rb | 5 +- test/models/food_test.rb | 27 ++++++ test/models/music_test.rb | 4 +- 4 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 test/cassettes/Food/BusinessInfo/can_find_a_business_on_yelp_using_food_id.yml diff --git a/test/cassettes/Food/BusinessInfo/can_find_a_business_on_yelp_using_food_id.yml b/test/cassettes/Food/BusinessInfo/can_find_a_business_on_yelp_using_food_id.yml new file mode 100644 index 0000000..19ffd85 --- /dev/null +++ b/test/cassettes/Food/BusinessInfo/can_find_a_business_on_yelp_using_food_id.yml @@ -0,0 +1,91 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/emerald-city-fish-and-chips-seattle + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="OFuS_es--gU4WgPN0xES8g", oauth_nonce="8df45a06ccc03b6944ce16f380621245", + oauth_signature="yu7J31Kpqc6kt%2Bj7CUgiotB%2B2rA%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463950504", oauth_token="3HBWJFKfS_8QI-4Oh2e1l02B84R7Jes6", + oauth_version="1.0" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Date: + - Sun, 22 May 2016 20:55:04 GMT + Content-Type: + - application/json; charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d9b621506baaa0f7e2983c67cb836389a1463950504; expires=Mon, 22-May-17 + 20:55:04 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=09fd0252cad207774570f5f0a0f8a5fd; Domain=.yelp.com; Path=/; HttpOnly + - yuv=5G1kMOcLiXN9rQ5Z1l2_NVxUliicLQTEjH9jwowiZk9m4YE4zsVBFtzlMKNgDPubgsMxnilMqJEQA4xtRHRoleh0moAKRDN_; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 20:55:04 + GMT + X-Node: + - 10-64-109-207-uswest1aprod + - api_com + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Sun, 22 May 2016 20:55:04 GMT + Pragma: + - no-cache + Vary: + - Accept-Encoding,User-Agent + X-Mode: + - ro + X-Proxied: + - 10-64-16-56-uswest1bprod + Server: + - cloudflare-nginx + Cf-Ray: + - 2a732abd179e1b97-SEA + body: + encoding: ASCII-8BIT + string: '{"is_claimed": true, "rating": 4.0, "mobile_url": "http://m.yelp.com/biz/emerald-city-fish-and-chips-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=OFuS_es--gU4WgPN0xES8g", + "rating_img_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png", + "review_count": 168, "name": "Emerald City Fish \u0026 Chips", "rating_img_url_small": + "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png", + "url": "http://www.yelp.com/biz/emerald-city-fish-and-chips-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=OFuS_es--gU4WgPN0xES8g", + "categories": [["Fish \u0026 Chips", "fishnchips"], ["Seafood", "seafood"], + ["Sandwiches", "sandwiches"]], "menu_date_updated": 1461367203, "reviews": + [{"rating": 5, "excerpt": "Fast, delicious and very affordable. \n\nNot the + best in town but pretty damn good. \n\nThey have some really good deals on + cod and salmon. \n\nPlus there''s...", "time_created": 1458677353, "rating_image_url": + "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/f1def11e4e79/ico/stars/v1/stars_5.png", + "rating_image_small_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/c7623205d5cd/ico/stars/v1/stars_small_5.png", + "user": {"image_url": "http://s3-media2.fl.yelpcdn.com/photo/KAjjds8VQ7C9j_hqZaSZGw/ms.jpg", + "id": "zqZN7C6M0ybbHUclJttmlw", "name": "Matthew A."}, "rating_image_large_url": + "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/22affc4e6c38/ico/stars/v1/stars_large_5.png", + "id": "Dqv0NYNg5Wsu2T97oQJYwA"}], "phone": "2067603474", "snippet_text": "Fast, + delicious and very affordable. \n\nNot the best in town but pretty damn good. + \n\nThey have some really good deals on cod and salmon. \n\nPlus there''s...", + "image_url": "https://s3-media3.fl.yelpcdn.com/bphoto/1HHsIopsUezmGi7fPR3NOw/ms.jpg", + "snippet_image_url": "http://s3-media2.fl.yelpcdn.com/photo/KAjjds8VQ7C9j_hqZaSZGw/ms.jpg", + "display_phone": "+1-206-760-3474", "rating_img_url_large": "https://s3-media2.fl.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png", + "menu_provider": "eat24", "id": "emerald-city-fish-and-chips-seattle", "is_closed": + false, "location": {"cross_streets": "Charlestown St \u0026 S 33rd Ave", "city": + "Seattle", "display_address": ["3756 Rainier Ave S", "Mount Baker", "Seattle, + WA 98144"], "geo_accuracy": 8.0, "neighborhoods": ["Mount Baker"], "postal_code": + "98144", "country_code": "US", "address": ["3756 Rainier Ave S"], "coordinate": + {"latitude": 47.57002, "longitude": -122.29063}, "state_code": "WA"}}' + http_version: + recorded_at: Sun, 22 May 2016 20:55:04 GMT +recorded_with: VCR 3.0.2 diff --git a/test/models/TunesTakeoutWrapper_test.rb b/test/models/TunesTakeoutWrapper_test.rb index 3f416f9..a0f1df7 100644 --- a/test/models/TunesTakeoutWrapper_test.rb +++ b/test/models/TunesTakeoutWrapper_test.rb @@ -47,10 +47,7 @@ class TunesTakeoutWrapperTest < ActiveSupport::TestCase assert_equal second_favorites, (first_favorites - 1) end - + end - - end - end \ No newline at end of file diff --git a/test/models/food_test.rb b/test/models/food_test.rb index e69de29..5b4b876 100644 --- a/test/models/food_test.rb +++ b/test/models/food_test.rb @@ -0,0 +1,27 @@ +require 'test_helper' + +class Music < ActiveSupport::TestCase + + describe Food do + + describe "BusinessInfo", :vcr do + before do + @results = [{ + "id"=>"Vz0KQY-RRwADboFN", + "food_id"=>"emerald-city-fish-and-chips-seattle", + "music_id"=>"18nhNX9AEFPINp1txOsaJS", + "music_type"=>"album" + }] + + @business = Food.get_food(@results) + end + + it "can find a business on yelp using food_id", :vcr do + assert_equal "Emerald City Fish & Chips", @business.first.name + end + + + end + end + +end \ No newline at end of file diff --git a/test/models/music_test.rb b/test/models/music_test.rb index 923f1d5..ce6d9e9 100644 --- a/test/models/music_test.rb +++ b/test/models/music_test.rb @@ -7,7 +7,9 @@ class Music < ActiveSupport::TestCase # describe "API" do # describe "Album" do # before do - # results = {"id"=>"Vz0KNY-RRwADbn2k", "food_id"=>"ohana-seattle-2", "music_id"=>"0DeXBSPxuMGmgT1MSrzXe2", "music_type"=>"album"} + # results = {""food_id":"avocados-mexican-restaurant-everett", + #{}"music_id":"0s2PZZynA0W2Z8iHnRZS48", + #{}"music_type":"track"} # @banana_album = Music.get_music(results) # end From 1e18eb63580fa60fcad801cab3db84ddd6603565 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 22 May 2016 14:29:06 -0700 Subject: [PATCH 34/46] music model tests complete including method calling to spotify. --- ...potify_and_return_the_name_of_an_album.yml | 117 ++++++++++++++++++ ..._find_a_business_on_yelp_using_food_id.yml | 28 ++--- ...l_to_spotify_and_return_the_music_type.yml | 117 ++++++++++++++++++ ...potify_and_return_the_name_of_an_album.yml | 117 ++++++++++++++++++ ...to_spotify_and_return_album_music_type.yml | 117 ++++++++++++++++++ ...l_to_spotify_and_return_the_music_type.yml | 117 ++++++++++++++++++ ...potify_and_return_the_name_of_an_album.yml | 117 ++++++++++++++++++ ...l_to_spotify_and_return_the_music_type.yml | 65 ++++++++++ ...otify_and_return_the_name_of_an_artist.yml | 65 ++++++++++ ...potify_and_return_artist_as_music_type.yml | 65 ++++++++++ ...l_to_spotify_and_return_the_music_type.yml | 65 ++++++++++ ...otify_and_return_the_name_of_an_artist.yml | 65 ++++++++++ ...l_to_spotify_and_return_the_music_type.yml | 65 ++++++++++ ...spotify_and_return_the_name_of_a_track.yml | 74 +++++++++++ ...otify_and_return_the_name_of_an_artist.yml | 65 ++++++++++ ...spotify_and_return_track_as_music_type.yml | 74 +++++++++++ test/models/food_test.rb | 2 +- test/models/music_test.rb | 103 ++++++++++++--- 18 files changed, 1404 insertions(+), 34 deletions(-) create mode 100644 test/cassettes/Food/AlbumInfo/can_make_call_to_spotify_and_return_the_name_of_an_album.yml create mode 100644 test/cassettes/Music/AlbumInfo/can_make_call_to_spotify_and_return_the_music_type.yml create mode 100644 test/cassettes/Music/AlbumInfo/can_make_call_to_spotify_and_return_the_name_of_an_album.yml create mode 100644 test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_album_music_type.yml create mode 100644 test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_the_music_type.yml create mode 100644 test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_the_name_of_an_album.yml create mode 100644 test/cassettes/Music/ArtistInfo/can_call_to_spotify_and_return_the_music_type.yml create mode 100644 test/cassettes/Music/ArtistInfo/can_call_to_spotify_and_return_the_name_of_an_artist.yml create mode 100644 test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_artist_as_music_type.yml create mode 100644 test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_the_music_type.yml create mode 100644 test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_the_name_of_an_artist.yml create mode 100644 test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_music_type.yml create mode 100644 test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_name_of_a_track.yml create mode 100644 test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_name_of_an_artist.yml create mode 100644 test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_track_as_music_type.yml diff --git a/test/cassettes/Food/AlbumInfo/can_make_call_to_spotify_and_return_the_name_of_an_album.yml b/test/cassettes/Food/AlbumInfo/can_make_call_to_spotify_and_return_the_name_of_an_album.yml new file mode 100644 index 0000000..a1782a9 --- /dev/null +++ b/test/cassettes/Food/AlbumInfo/can_make_call_to_spotify_and_return_the_name_of_an_album.yml @@ -0,0 +1,117 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/albums/18nhNX9AEFPINp1txOsaJS + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:01:00 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAOydWVPjOhaA3++vcPEw89J90b501dQU0CyBALlhaWBqitKa + uMlG7ITl1v3v4ygQaJI4xLkwL+4HdZCOj+RjnU86lmX/+VsUramWHrSv04ee + W4u+Pf259iWU9NM4SZNR9n+iP7OcLM/dp67fUa3rQb8VSsb5WUnS66axfwhK + mmnaS76tr3d7rvP7U8HvptteH6tc56hydLp/Rx7/uDndrse7rI7rB+laUPXX + l3FNzb7zvyhTvfgXXUP4pC6Zp+9JU2yDnnyhjmqPDbDVd6od1WL3XPJimlDb + c/agH4fcpyZ9G5d+m39qf0X/HZt1qOKW0i133Vb9G/ds4LWN+tqXLD0L6eko + 3dwO6XFIQ+nm7ijd2ghpNaShdCuUbl2G9GqUfj8IaSj9HvRsb4U0/D45H6U7 + lZCGY3fHaah37yikQcNeaE/lJKTh2EqQqQYN1fHvIHMYaj8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//wMAAzrzyUJpAAA= + http_version: + recorded_at: Sun, 22 May 2016 21:01:00 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Food/BusinessInfo/can_find_a_business_on_yelp_using_food_id.yml b/test/cassettes/Food/BusinessInfo/can_find_a_business_on_yelp_using_food_id.yml index 19ffd85..4966714 100644 --- a/test/cassettes/Food/BusinessInfo/can_find_a_business_on_yelp_using_food_id.yml +++ b/test/cassettes/Food/BusinessInfo/can_find_a_business_on_yelp_using_food_id.yml @@ -10,9 +10,9 @@ http_interactions: User-Agent: - Faraday v0.9.2 Authorization: - - OAuth oauth_consumer_key="OFuS_es--gU4WgPN0xES8g", oauth_nonce="8df45a06ccc03b6944ce16f380621245", - oauth_signature="yu7J31Kpqc6kt%2Bj7CUgiotB%2B2rA%3D", oauth_signature_method="HMAC-SHA1", - oauth_timestamp="1463950504", oauth_token="3HBWJFKfS_8QI-4Oh2e1l02B84R7Jes6", + - OAuth oauth_consumer_key="OFuS_es--gU4WgPN0xES8g", oauth_nonce="554144b91d34a9e64fcf6adb0271ac26", + oauth_signature="sCF7Qz%2BaOW%2BE6G6hr8afp%2B5uYaI%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463950649", oauth_token="3HBWJFKfS_8QI-4Oh2e1l02B84R7Jes6", oauth_version="1.0" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 @@ -24,7 +24,7 @@ http_interactions: message: OK headers: Date: - - Sun, 22 May 2016 20:55:04 GMT + - Sun, 22 May 2016 20:57:30 GMT Content-Type: - application/json; charset=UTF-8 Transfer-Encoding: @@ -32,19 +32,19 @@ http_interactions: Connection: - keep-alive Set-Cookie: - - __cfduid=d9b621506baaa0f7e2983c67cb836389a1463950504; expires=Mon, 22-May-17 - 20:55:04 GMT; path=/; domain=.yelp.com; HttpOnly - - bse=09fd0252cad207774570f5f0a0f8a5fd; Domain=.yelp.com; Path=/; HttpOnly - - yuv=5G1kMOcLiXN9rQ5Z1l2_NVxUliicLQTEjH9jwowiZk9m4YE4zsVBFtzlMKNgDPubgsMxnilMqJEQA4xtRHRoleh0moAKRDN_; - Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 20:55:04 + - __cfduid=d4942991a8e404cf9b05fe7eb58323a5b1463950649; expires=Mon, 22-May-17 + 20:57:29 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=89d7fb5052e563bebe3a072cf4557d88; Domain=.yelp.com; Path=/; HttpOnly + - yuv=N_KdXMzUn8TbQBQ-UJOQ5QFYliGP9pEjhAHgYMfZREqLD361IKU617hMpur0L2b4aMtT-xCqFbuL6dLj7mwDHFkH02-BMHvA; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 20:57:30 GMT X-Node: - - 10-64-109-207-uswest1aprod - api_com + - web35-r6-sfo2 Cache-Control: - max-age=0, must-revalidate, no-cache, no-store, private Expires: - - Sun, 22 May 2016 20:55:04 GMT + - Sun, 22 May 2016 20:57:29 GMT Pragma: - no-cache Vary: @@ -52,11 +52,11 @@ http_interactions: X-Mode: - ro X-Proxied: - - 10-64-16-56-uswest1bprod + - extlb8-r11-sfo2 Server: - cloudflare-nginx Cf-Ray: - - 2a732abd179e1b97-SEA + - 2a732e49e5c70c47-SEA body: encoding: ASCII-8BIT string: '{"is_claimed": true, "rating": 4.0, "mobile_url": "http://m.yelp.com/biz/emerald-city-fish-and-chips-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=OFuS_es--gU4WgPN0xES8g", @@ -87,5 +87,5 @@ http_interactions: "98144", "country_code": "US", "address": ["3756 Rainier Ave S"], "coordinate": {"latitude": 47.57002, "longitude": -122.29063}, "state_code": "WA"}}' http_version: - recorded_at: Sun, 22 May 2016 20:55:04 GMT + recorded_at: Sun, 22 May 2016 20:57:29 GMT recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/AlbumInfo/can_make_call_to_spotify_and_return_the_music_type.yml b/test/cassettes/Music/AlbumInfo/can_make_call_to_spotify_and_return_the_music_type.yml new file mode 100644 index 0000000..27a51df --- /dev/null +++ b/test/cassettes/Music/AlbumInfo/can_make_call_to_spotify_and_return_the_music_type.yml @@ -0,0 +1,117 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/albums/18nhNX9AEFPINp1txOsaJS + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:02:33 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAOydWVPjOhaA3++vcPEw89J90b501dQU0CyBALlhaWBqitKa + uMlG7ITl1v3v4ygQaJI4xLkwL+4HdZCOj+RjnU86lmX/+VsUramWHrSv04ee + W4u+Pf259iWU9NM4SZNR9n+iP7OcLM/dp67fUa3rQb8VSsb5WUnS66axfwhK + mmnaS76tr3d7rvP7U8HvptteH6tc56hydLp/Rx7/uDndrse7rI7rB+laUPXX + l3FNzb7zvyhTvfgXXUP4pC6Zp+9JU2yDnnyhjmqPDbDVd6od1WL3XPJimlDb + c/agH4fcpyZ9G5d+m39qf0X/HZt1qOKW0i133Vb9G/ds4LWN+tqXLD0L6eko + 3dwO6XFIQ+nm7ijd2ghpNaShdCuUbl2G9GqUfj8IaSj9HvRsb4U0/D45H6U7 + lZCGY3fHaah37yikQcNea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753M + +ubRFFxGRd/mfTnlr/8BAAD//wMAAzrzyUJpAAA= + http_version: + recorded_at: Sun, 22 May 2016 21:02:32 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/AlbumInfo/can_make_call_to_spotify_and_return_the_name_of_an_album.yml b/test/cassettes/Music/AlbumInfo/can_make_call_to_spotify_and_return_the_name_of_an_album.yml new file mode 100644 index 0000000..27a51df --- /dev/null +++ b/test/cassettes/Music/AlbumInfo/can_make_call_to_spotify_and_return_the_name_of_an_album.yml @@ -0,0 +1,117 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/albums/18nhNX9AEFPINp1txOsaJS + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:02:33 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAOydWVPjOhaA3++vcPEw89J90b501dQU0CyBALlhaWBqitKa + uMlG7ITl1v3v4ygQaJI4xLkwL+4HdZCOj+RjnU86lmX/+VsUramWHrSv04ee + W4u+Pf259iWU9NM4SZNR9n+iP7OcLM/dp67fUa3rQb8VSsb5WUnS66axfwhK + mmnaS76tr3d7rvP7U8HvptteH6tc56hydLp/Rx7/uDndrse7rI7rB+laUPXX + l3FNzb7zvyhTvfgXXUP4pC6Zp+9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R/36e1hp3prq5UYXg5OxGrxZiz1Y5FWIvEHtB5KDT6D9EvtuP + DtVD07WLYhJ4ZTLjSkYFyyJrpoQWAnhmKSUGj3ZoW4SFzHvDeNGtNHlmnvjp + Wvg+w+jo55W6tc7Tx1Y6g1brKWv8NYdR5rNQOL/uIHkjmHZT1Rq3+rfn753M + +ubRFFxGRd/mfTnlr/8BAAD//wMAAzrzyUJpAAA= + http_version: + recorded_at: Sun, 22 May 2016 21:02:32 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_album_music_type.yml b/test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_album_music_type.yml new file mode 100644 index 0000000..d708a69 --- /dev/null +++ b/test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_album_music_type.yml @@ -0,0 +1,117 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/albums/18nhNX9AEFPINp1txOsaJS + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:22:06 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAOydWVPjOhaA3++vcPEw89J90b501dQU0CyBALlhaWBqitKa + uMlG7ITl1v3v4ygQaJI4xLkwL+4HdZCOj+RjnU86lmX/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gW3kmTY9sSjiUcSzguC0dACJv9Sp8P + ibCHB3vVo2ZydAHI1ePp8HhwiU2yWoQ9W+VUhL1AbOIse900OnGdJFipKCK9 + cp4yYzFhGjroGKQZHqExRELOhNNUYqlcXohddBdNnolLRJaILBG5JCIhJxDO + fqXPh4TYarBR/36e1hp3prq5UYXg5OxGrxZiz1Y5FWIvEHtB5KDT6D9EvtuP + DtVD07WLYhJ4ZTLjSkYFyyJrpoQWAnhmKSUGj3ZoW4SFzHvDeNGtNHlmnvjp + Wvg+w+jo55W6tc7Tx1Y6g1brKWv8NYdR5rNQOL/uIHkjmHZT1Rq3+rfn753M + +ubRFFxGRd/mfTnlr/8BAAD//wMAAzrzyUJpAAA= + http_version: + recorded_at: Sun, 22 May 2016 21:22:06 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_the_music_type.yml b/test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_the_music_type.yml new file mode 100644 index 0000000..0b718d3 --- /dev/null +++ b/test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_the_music_type.yml @@ -0,0 +1,117 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/albums/18nhNX9AEFPINp1txOsaJS + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:18:18 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAOydWVPjOhaA3++vcPEw89J90b501dQU0CyBALlhaWBqitKa + uMlG7ITl1v3v4ygQaJI4xLkwL+4HdZCOj+RjnU86lmX/+VsUramWHrSv04ee + W4u+Pf259iWU9NM4SZNR9n+iP7OcLM/dp67fUa3rQb8VSsb5WUnS66axfwhK + mmnaS76tr3d7rvP7U8HvptteH6tc56hydLp/Rx7/uDndrse7rI7rB+laUPXX + l3FNzb7zvyhTvfgXXUP4pC6Zp+9JU2yDnnyhjmqPDbDVd6od1WL3XPJimlDb + c/agH4fcpyZ9G5d+m39qf0X/HZt1qOKW0i133Vb9G/ds4LWN+tqXLD0L6eko + 3dwO6XFIQ+nm7ijd2ghpNaShdCuUbl2G9GqUfj8IaSj9HvRsb4U0/D45H6U7 + lZCGY3fHaah37yikQcNeaE/lJKTh2EqQqQYN1fHvIHMYaj8MOYcXo/QotPAo + tOco1HUU2lML7a8F+VrQWdsLaZCvBQ0n4UxPQhu2Q+0nQXIrSJ7+CGlo81nQ + cxZkdjeD9b6HVoUaD8NZV76vPVnfdHsP/bjRfNOv06xjh8uJAKTR/D6wFa7k + l2UPq73uABMfiu0rF1ob9My4nwKEMYGSMwnHtf023/He6XYjp16HotM8upAb + 2zu1ylEPpvfHido/eami4Tp992SWcUvf5YMj3ck85UHNkwPmirRVw/16SZpu + dJlGWYyAidO1fmlP1hpjO1lT1oOCdQeoMBIo6gg0HBGgFbbWUeoMdJwDQb30 + SJDnC3QX27T5VMUvF/alcgzeWzllynBKiFXQSyY1MNhiDrzO/sIeYKcxFhqy + qcqzKuZUzsg76ybUMSEBhN575BnVWnJAtNUCKS8cRdgyBWee+KueOYEgBNGl + U/0k6vqXXh0hAGj0NRr19fFV63V7g5bqx2nofzzk9V3LqcRdW5W6iWt8BeQr + hGtTAte9vjNxEnc7QdSqh7FM2lfm5nU3X7knro9V/rvrfeLSf4F/t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ujo + NT7WWkmZ1cRKZbL4GgHhOGaI0SwGz3vEBxbdTZNn4hKRJSJLRC6LyMyV+Wfu + puncIIMb7uTq4MbdHpD+ufIn96vdi5ytcupe5AKxl7dWdKNNVRiOBDkMAPIc + YMuIMTCLrqFxEiGCfRZaeyp0Fm7DHDgW3kmTY9sSjiUcSzguC0dACJv9Sp8P + ibCHB3vVo2ZydAHI1ePp8HhwiU2yWoQ9W+VUhL1AbOIse900OnGdJFipKCK9 + cp4yYzFhGjroGKQZHqExRELOhNNUYqlcXohddBdNnolLRJaILBG5JCIhJxDO + fqXPh4TYarBR/36e1hp3prq5UYXg5OxGrxZiz1Y5FWIvEHtB5KDT6D9EvtuP + DtVD07WLYhJ4ZTLjSkYFyyJrpoQWAnhmKSUGj3ZoW4SFzHvDeNGtNHlmnvjp + Wvg+w+jo55W6tc7Tx1Y6g1brKWv8NYdR5rNQOL/uIHkjmHZT1Rq3+rfn753M + +ubRFFxGRd/mfTnlr/8BAAD//wMAAzrzyUJpAAA= + http_version: + recorded_at: Sun, 22 May 2016 21:18:17 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_the_name_of_an_album.yml b/test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_the_name_of_an_album.yml new file mode 100644 index 0000000..0b718d3 --- /dev/null +++ b/test/cassettes/Music/Album_Info/can_make_call_to_spotify_and_return_the_name_of_an_album.yml @@ -0,0 +1,117 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/albums/18nhNX9AEFPINp1txOsaJS + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:18:18 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAOydWVPjOhaA3++vcPEw89J90b501dQU0CyBALlhaWBqitKa + uMlG7ITl1v3v4ygQaJI4xLkwL+4HdZCOj+RjnU86lmX/+VsUramWHrSv04ee + W4u+Pf259iWU9NM4SZNR9n+iP7OcLM/dp67fUa3rQb8VSsb5WUnS66axfwhK + mmnaS76tr3d7rvP7U8HvptteH6tc56hydLp/Rx7/uDndrse7rI7rB+laUPXX + l3FNzb7zvyhTvfgXXUP4pC6Zp+9JU2yDnnyhjmqPDbDVd6od1WL3XPJimlDb + c/agH4fcpyZ9G5d+m39qf0X/HZt1qOKW0i133Vb9G/ds4LWN+tqXLD0L6eko + 3dwO6XFIQ+nm7ijd2ghpNaShdCuUbl2G9GqUfj8IaSj9HvRsb4U0/D45H6U7 + lZCGY3fHaah37yikQcNeaE/lJKTh2EqQqQYN1fHvIHMYaj8MOYcXo/QotPAo + tOco1HUU2lML7a8F+VrQWdsLaZCvBQ0n4UxPQhu2Q+0nQXIrSJ7+CGlo81nQ + cxZkdjeD9b6HVoUaD8NZV76vPVnfdHsP/bjRfNOv06xjh8uJAKTR/D6wFa7k + l2UPq73uABMfiu0rF1ob9My4nwKEMYGSMwnHtf023/He6XYjp16HotM8upAb + 2zu1ylEPpvfHido/eami4Tp992SWcUvf5YMj3ck85UHNkwPmirRVw/16SZpu + dJlGWYyAidO1fmlP1hpjO1lT1oOCdQeoMBIo6gg0HBGgFbbWUeoMdJwDQb30 + SJDnC3QX27T5VMUvF/alcgzeWzllynBKiFXQSyY1MNhiDrzO/sIeYKcxFhq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5v7FrjLpcLX9hnNUToXYC8RePedj3Og5n9H/RQmpFaOGcGG5 + IERDz5AlyHLkGEOEa59F2QQqg3IIWXQrTZ6FS0KWhCwJuSwhIZLw8xaw2dWj + 6Vz5i91+Wr+qeSftRvXscLX1mdkqp9ZnFoi9WsAeuqiSZHPIuGOLItJ4Tujo + NT7WWkmZ1cRKZbL4GgHhOGaI0SwGz3vEBxbdTZNn4hKRJSJLRC6LyMyV+Wfu + puncIIMb7uTq4MbdHpD+ufIn96vdi5ytcupe5AKxl7dWdKNNVRiOBDkMAPIc + YMuIMTCLrqFxEiGCfRZaeyp0Fm7DHDgW3kmTY9sSjiUcSzguC0dACJv9Sp8P + ibCHB3vVo2ZydAHI1ePp8HhwiU2yWoQ9W+VUhL1AbOIse900OnGdJFipKCK9 + cp4yYzFhGjroGKQZHqExRELOhNNUYqlcXohddBdNnolLRJaILBG5JCIhJxDO + fqXPh4TYarBR/36e1hp3prq5UYXg5OxGrxZiz1Y5FWIvEHtB5KDT6D9EvtuP + DtVD07WLYhJ4ZTLjSkYFyyJrpoQWAnhmKSUGj3ZoW4SFzHvDeNGtNHlmnvjp + Wvg+w+jo55W6tc7Tx1Y6g1brKWv8NYdR5rNQOL/uIHkjmHZT1Rq3+rfn753M + +ubRFFxGRd/mfTnlr/8BAAD//wMAAzrzyUJpAAA= + http_version: + recorded_at: Sun, 22 May 2016 21:18:17 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/ArtistInfo/can_call_to_spotify_and_return_the_music_type.yml b/test/cassettes/Music/ArtistInfo/can_call_to_spotify_and_return_the_music_type.yml new file mode 100644 index 0000000..4df8ed8 --- /dev/null +++ b/test/cassettes/Music/ArtistInfo/can_call_to_spotify_and_return_the_music_type.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/2KVkJsyOoELcQQNzC9ajLJ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:17:14 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAIySMW+DMBCF9/4KxNApCmCDMaxRO6RRqyxdqqo64yPQEEDG + NE2j/veCIVGjNFVGP9+97/l8+xvLsvFToyqheGtV0dhWbO07tdObutJ5uusV + O9O6bmLHqWosp+PFNKk2DiidN9ohD8/rebN7qu4WyXL5+DWL4H0xtzuj70nP + SKuiqLaofvtnCtP+WLZFMRkkXWkoeo0eO1dYKjRtL9arUQ59x1BQ5yeZPrwx + VnMpl/HJpXH5t2QDqwP8kBrzVaZ7ifnuGLsb3EmgLk4iyy6LYwwc4gEHGnGO + 3A/dUDLu+imEaSBBkFBQTtKECs7s0W+bS52NCDOIczh1r4V7vuCCYSCQQOpT + VyQREUA4kS6XQARKITHwojN4h7gAZ/61bE8ICknAGESBRKAoOQuRhoHHQhkw + yUPweSD+eHiPHj+8hA0azL2Ccr2zbi2doTXLEBsc/qmu6rYAlWuzrWYytt7V + Q9ewC0Nhq3KjjesSD3fxpfX9/gEAAP//AwB+3ztiIQMAAA== + http_version: + recorded_at: Sun, 22 May 2016 21:17:14 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/ArtistInfo/can_call_to_spotify_and_return_the_name_of_an_artist.yml b/test/cassettes/Music/ArtistInfo/can_call_to_spotify_and_return_the_name_of_an_artist.yml new file mode 100644 index 0000000..bdb3231 --- /dev/null +++ b/test/cassettes/Music/ArtistInfo/can_call_to_spotify_and_return_the_name_of_an_artist.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/2KVkJsyOoELcQQNzC9ajLJ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:17:15 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAIySMW+DMBCF9/4KxNApCmCDMaxRO6RRqyxdqqo64yPQEEDG + NE2j/veCIVGjNFVGP9+97/l8+xvLsvFToyqheGtV0dhWbO07tdObutJ5uusV + O9O6bmLHqWosp+PFNKk2DiidN9ohD8/rebN7qu4WyXL5+DWL4H0xtzuj70nP + SKuiqLaofvtnCtP+WLZFMRkkXWkoeo0eO1dYKjRtL9arUQ59x1BQ5yeZPrwx + VnMpl/HJpXH5t2QDqwP8kBrzVaZ7ifnuGLsb3EmgLk4iyy6LYwwc4gEHGnGO + 3A/dUDLu+imEaSBBkFBQTtKECs7s0W+bS52NCDOIczh1r4V7vuCCYSCQQOpT + VyQREUA4kS6XQARKITHwojN4h7gAZ/61bE8ICknAGESBRKAoOQuRhoHHQhkw + yUPweSD+eHiPHj+8hA0azL2Ccr2zbi2doTXLEBsc/qmu6rYAlWuzrWYytt7V + Q9ewC0Nhq3KjjesSD3fxpfX9/gEAAP//AwB+3ztiIQMAAA== + http_version: + recorded_at: Sun, 22 May 2016 21:17:14 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_artist_as_music_type.yml b/test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_artist_as_music_type.yml new file mode 100644 index 0000000..3bbd97d --- /dev/null +++ b/test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_artist_as_music_type.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/2KVkJsyOoELcQQNzC9ajLJ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:22:04 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAIySMW+DMBCF9/4KxNApCmCDMaxRO6RRqyxdqqo64yPQEEDG + NE2j/veCIVGjNFVGP9+97/l8+xvLsvFToyqheGtV0dhWbO07tdObutJ5uusV + O9O6bmLHqWosp+PFNKk2DiidN9ohD8/rebN7qu4WyXL5+DWL4H0xtzuj70nP + SKuiqLaofvtnCtP+WLZFMRkkXWkoeo0eO1dYKjRtL9arUQ59x1BQ5yeZPrwx + VnMpl/HJpXH5t2QDqwP8kBrzVaZ7ifnuGLsb3EmgLk4iyy6LYwwc4gEHGnGO + 3A/dUDLu+imEaSBBkFBQTtKECs7s0W+bS52NCDOIczh1r4V7vuCCYSCQQOpT + VyQREUA4kS6XQARKITHwojN4h7gAZ/61bE8ICknAGESBRKAoOQuRhoHHQhkw + yUPweSD+eHiPHj+8hA0azL2Ccr2zbi2doTXLEBsc/qmu6rYAlWuzrWYytt7V + Q9ewC0Nhq3KjjesSD3fxpfX9/gEAAP//AwB+3ztiIQMAAA== + http_version: + recorded_at: Sun, 22 May 2016 21:22:04 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_the_music_type.yml b/test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_the_music_type.yml new file mode 100644 index 0000000..6f5f3b3 --- /dev/null +++ b/test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_the_music_type.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/2KVkJsyOoELcQQNzC9ajLJ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:18:18 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAIySMW+DMBCF9/4KxNApCmCDMaxRO6RRqyxdqqo64yPQEEDG + NE2j/veCIVGjNFVGP9+97/l8+xvLsvFToyqheGtV0dhWbO07tdObutJ5uusV + O9O6bmLHqWosp+PFNKk2DiidN9ohD8/rebN7qu4WyXL5+DWL4H0xtzuj70nP + SKuiqLaofvtnCtP+WLZFMRkkXWkoeo0eO1dYKjRtL9arUQ59x1BQ5yeZPrwx + VnMpl/HJpXH5t2QDqwP8kBrzVaZ7ifnuGLsb3EmgLk4iyy6LYwwc4gEHGnGO + 3A/dUDLu+imEaSBBkFBQTtKECs7s0W+bS52NCDOIczh1r4V7vuCCYSCQQOpT + VyQREUA4kS6XQARKITHwojN4h7gAZ/61bE8ICknAGESBRKAoOQuRhoHHQhkw + yUPweSD+eHiPHj+8hA0azL2Ccr2zbi2doTXLEBsc/qmu6rYAlWuzrWYytt7V + Q9ewC0Nhq3KjjesSD3fxpfX9/gEAAP//AwB+3ztiIQMAAA== + http_version: + recorded_at: Sun, 22 May 2016 21:18:18 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_the_name_of_an_artist.yml b/test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_the_name_of_an_artist.yml new file mode 100644 index 0000000..6f5f3b3 --- /dev/null +++ b/test/cassettes/Music/Artist_Info/can_call_to_spotify_and_return_the_name_of_an_artist.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/2KVkJsyOoELcQQNzC9ajLJ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:18:18 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAIySMW+DMBCF9/4KxNApCmCDMaxRO6RRqyxdqqo64yPQEEDG + NE2j/veCIVGjNFVGP9+97/l8+xvLsvFToyqheGtV0dhWbO07tdObutJ5uusV + O9O6bmLHqWosp+PFNKk2DiidN9ohD8/rebN7qu4WyXL5+DWL4H0xtzuj70nP + SKuiqLaofvtnCtP+WLZFMRkkXWkoeo0eO1dYKjRtL9arUQ59x1BQ5yeZPrwx + VnMpl/HJpXH5t2QDqwP8kBrzVaZ7ifnuGLsb3EmgLk4iyy6LYwwc4gEHGnGO + 3A/dUDLu+imEaSBBkFBQTtKECs7s0W+bS52NCDOIczh1r4V7vuCCYSCQQOpT + VyQREUA4kS6XQARKITHwojN4h7gAZ/61bE8ICknAGESBRKAoOQuRhoHHQhkw + yUPweSD+eHiPHj+8hA0azL2Ccr2zbi2doTXLEBsc/qmu6rYAlWuzrWYytt7V + Q9ewC0Nhq3KjjesSD3fxpfX9/gEAAP//AwB+3ztiIQMAAA== + http_version: + recorded_at: Sun, 22 May 2016 21:18:18 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_music_type.yml b/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_music_type.yml new file mode 100644 index 0000000..6f5f3b3 --- /dev/null +++ b/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_music_type.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/2KVkJsyOoELcQQNzC9ajLJ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:18:18 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAIySMW+DMBCF9/4KxNApCmCDMaxRO6RRqyxdqqo64yPQEEDG + NE2j/veCIVGjNFVGP9+97/l8+xvLsvFToyqheGtV0dhWbO07tdObutJ5uusV + O9O6bmLHqWosp+PFNKk2DiidN9ohD8/rebN7qu4WyXL5+DWL4H0xtzuj70nP + SKuiqLaofvtnCtP+WLZFMRkkXWkoeo0eO1dYKjRtL9arUQ59x1BQ5yeZPrwx + VnMpl/HJpXH5t2QDqwP8kBrzVaZ7ifnuGLsb3EmgLk4iyy6LYwwc4gEHGnGO + 3A/dUDLu+imEaSBBkFBQTtKECs7s0W+bS52NCDOIczh1r4V7vuCCYSCQQOpT + VyQREUA4kS6XQARKITHwojN4h7gAZ/61bE8ICknAGESBRKAoOQuRhoHHQhkw + yUPweSD+eHiPHj+8hA0azL2Ccr2zbi2doTXLEBsc/qmu6rYAlWuzrWYytt7V + Q9ewC0Nhq3KjjesSD3fxpfX9/gEAAP//AwB+3ztiIQMAAA== + http_version: + recorded_at: Sun, 22 May 2016 21:18:18 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_name_of_a_track.yml b/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_name_of_a_track.yml new file mode 100644 index 0000000..b16e606 --- /dev/null +++ b/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_name_of_a_track.yml @@ -0,0 +1,74 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/tracks/1RIw3X80k7wegvnIZ3bRzO + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:22:07 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAOxUTVPbMBC991dkfKbYsmxLzi1fkExJSAmBQKeTkWWFaHAS + j+0EKMN/b/xsQgMJZdpDL728sXbXb59Wu/v4qVIxRBQsZ0alWnlcn57P4+wh + VrmxdB+UvpXQkQgiNZ6J5FZlaR7yrWLUzoyDNQ6B5znWW8BTILz14xwbNeAJ + EN4GvI0r4HWOzS9AeJvgaTWA+B5c5HjUAeLf4wKRt90DgqENPZ0BEP92EHMC + hpPiGzFdZO/C0h3l2IPCHvT0kKsHPX3o7yO+D85+G4j4PhgGuOkAGlrIPkBk + A5Hnl0BoHoJniJjjOqrXhCpk7OLWnaZR+V7WX91nKpmLaLxMovTlzdaeNF5k + evKAJ5tmWZxWTXMRq/lh6TiUi5mJtzS9fqOejKxwkMRLa8XaIzYadpUBpqcy + 0TRRky0uEestqhUp2NJ9dCWRDkHzm6CZuFFlL21uNFX6ZprlRs+xDp6t64tv + 6VqrkuF8LckEiUkcomTo2YJyrlzPcwJvQrnNfG4FlvRDR1LLmbiOsWG802E2 + LdOUNdglglofF+EIx2E+dRwlmVLUJbYdepzL0OdM2pbgrmR+GLg7RKzTvCPC + cz6swVOWosyiEy45JSEnxCeMOaEbKskVDyw3pDYLJjsLUUjYtN1czIpl0Jgq + lW6ebfeOWCYaxrJbqnBW9zcdWs4QSabTbKsH/rrbQWmyequXndSCr6MVjaLe + Jb3uOhf1P2j3QuE+vu1+fz9oU8/atNIWi7f1RKq9BYW3uv9e5cP939b/clsb + oU7leL6cBSrJ604K4zIRmV7MxzM8BuHrReHBo+7jSEuNMZ+IKFWltRwBHf4y + AYZOE4meGLSuTr8Qz/JtSl+Gac/gfGxsskTIW5Ocde7oiFu37E7drOadaxqc + /Th9SfGRiQFTuo8KNOW4vBeyGZajxSLS6bRyIeRSZw+FN17Ey0gk+Tnfnm5h + TNRKq7vx6x0Zb3bkLKafyyjTFYr73KecUcKUaxFJLCUkDYitbMYIswkXE1ms + PQOXevOum9GFu4h8PbdwVfcV9uknAAAA//8DALC1ZVWNCQAA + http_version: + recorded_at: Sun, 22 May 2016 21:22:06 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_name_of_an_artist.yml b/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_name_of_an_artist.yml new file mode 100644 index 0000000..6f5f3b3 --- /dev/null +++ b/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_the_name_of_an_artist.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/2KVkJsyOoELcQQNzC9ajLJ + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:18:18 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAIySMW+DMBCF9/4KxNApCmCDMaxRO6RRqyxdqqo64yPQEEDG + NE2j/veCIVGjNFVGP9+97/l8+xvLsvFToyqheGtV0dhWbO07tdObutJ5uusV + O9O6bmLHqWosp+PFNKk2DiidN9ohD8/rebN7qu4WyXL5+DWL4H0xtzuj70nP + SKuiqLaofvtnCtP+WLZFMRkkXWkoeo0eO1dYKjRtL9arUQ59x1BQ5yeZPrwx + VnMpl/HJpXH5t2QDqwP8kBrzVaZ7ifnuGLsb3EmgLk4iyy6LYwwc4gEHGnGO + 3A/dUDLu+imEaSBBkFBQTtKECs7s0W+bS52NCDOIczh1r4V7vuCCYSCQQOpT + VyQREUA4kS6XQARKITHwojN4h7gAZ/61bE8ICknAGESBRKAoOQuRhoHHQhkw + yUPweSD+eHiPHj+8hA0azL2Ccr2zbi2doTXLEBsc/qmu6rYAlWuzrWYytt7V + Q9ewC0Nhq3KjjesSD3fxpfX9/gEAAP//AwB+3ztiIQMAAA== + http_version: + recorded_at: Sun, 22 May 2016 21:18:18 GMT +recorded_with: VCR 3.0.2 diff --git a/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_track_as_music_type.yml b/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_track_as_music_type.yml new file mode 100644 index 0000000..ae39d3b --- /dev/null +++ b/test/cassettes/Music/Track_Info/can_call_to_spotify_and_return_track_as_music_type.yml @@ -0,0 +1,74 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/tracks/1RIw3X80k7wegvnIZ3bRzO + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*; q=0.5, application/xml" + Accept-Encoding: + - gzip, deflate + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Sun, 22 May 2016 21:22:07 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Keep-Alive: + - timeout=600 + Cache-Control: + - public, max-age=7200 + Access-Control-Allow-Origin: + - "*" + Access-Control-Allow-Methods: + - GET, POST, OPTIONS, PUT, DELETE + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Max-Age: + - '604800' + Access-Control-Allow-Headers: + - Accept, Authorization, Origin, Content-Type + Content-Encoding: + - gzip + X-Content-Type-Options: + - nosniff + Strict-Transport-Security: + - max-age=31536000; + body: + encoding: ASCII-8BIT + string: !binary |- + H4sIAAAAAAAAAOxUTVPbMBC991dkfKbYsmxLzi1fkExJSAmBQKeTkWWFaHAS + j+0EKMN/b/xsQgMJZdpDL728sXbXb59Wu/v4qVIxRBQsZ0alWnlcn57P4+wh + VrmxdB+UvpXQkQgiNZ6J5FZlaR7yrWLUzoyDNQ6B5znWW8BTILz14xwbNeAJ + EN4GvI0r4HWOzS9AeJvgaTWA+B5c5HjUAeLf4wKRt90DgqENPZ0BEP92EHMC + hpPiGzFdZO/C0h3l2IPCHvT0kKsHPX3o7yO+D85+G4j4PhgGuOkAGlrIPkBk + A5Hnl0BoHoJniJjjOqrXhCpk7OLWnaZR+V7WX91nKpmLaLxMovTlzdaeNF5k + evKAJ5tmWZxWTXMRq/lh6TiUi5mJtzS9fqOejKxwkMRLa8XaIzYadpUBpqcy + 0TRRky0uEestqhUp2NJ9dCWRDkHzm6CZuFFlL21uNFX6ZprlRs+xDp6t64tv + 6VqrkuF8LckEiUkcomTo2YJyrlzPcwJvQrnNfG4FlvRDR1LLmbiOsWG802E2 + LdOUNdglglofF+EIx2E+dRwlmVLUJbYdepzL0OdM2pbgrmR+GLg7RKzTvCPC + cz6swVOWosyiEy45JSEnxCeMOaEbKskVDyw3pDYLJjsLUUjYtN1czIpl0Jgq + lW6ebfeOWCYaxrJbqnBW9zcdWs4QSabTbKsH/rrbQWmyequXndSCr6MVjaLe + Jb3uOhf1P2j3QuE+vu1+fz9oU8/atNIWi7f1RKq9BYW3uv9e5cP939b/clsb + oU7leL6cBSrJ604K4zIRmV7MxzM8BuHrReHBo+7jSEuNMZ+IKFWltRwBHf4y + AYZOE4meGLSuTr8Qz/JtSl+Gac/gfGxsskTIW5Ocde7oiFu37E7drOadaxqc + /Th9SfGRiQFTuo8KNOW4vBeyGZajxSLS6bRyIeRSZw+FN17Ey0gk+Tnfnm5h + TNRKq7vx6x0Zb3bkLKafyyjTFYr73KecUcKUaxFJLCUkDYitbMYIswkXE1ms + PQOXevOum9GFu4h8PbdwVfcV9uknAAAA//8DALC1ZVWNCQAA + http_version: + recorded_at: Sun, 22 May 2016 21:22:07 GMT +recorded_with: VCR 3.0.2 diff --git a/test/models/food_test.rb b/test/models/food_test.rb index 5b4b876..d78b9ea 100644 --- a/test/models/food_test.rb +++ b/test/models/food_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class Music < ActiveSupport::TestCase +class FoodTest < ActiveSupport::TestCase describe Food do diff --git a/test/models/music_test.rb b/test/models/music_test.rb index ce6d9e9..410201f 100644 --- a/test/models/music_test.rb +++ b/test/models/music_test.rb @@ -1,23 +1,88 @@ require 'test_helper' -class Music < ActiveSupport::TestCase - - # describe Music do - - # describe "API" do - # describe "Album" do - # before do - # results = {""food_id":"avocados-mexican-restaurant-everett", - #{}"music_id":"0s2PZZynA0W2Z8iHnRZS48", - #{}"music_type":"track"} - # @banana_album = Music.get_music(results) - # end - - # it "can find an album name", :vcr do - # assert_equal "Banana Slug String Band", @banana_album.name - # end - # end - # end - # end +class MusicTest < ActiveSupport::TestCase + describe Music do + + describe "Album Info", :vcr do + before do + @album_results = [{ + "id"=>"Vz0KQY-RRwADboFN", + "food_id"=>"emerald-city-fish-and-chips-seattle", + "music_id"=>"18nhNX9AEFPINp1txOsaJS", + "music_type"=>"album" + }] + + @album = Music.get_music(@album_results) + end + + it "can make call to spotify and return the name of an album", :vcr do + assert_equal "10 Years of Cream Pie 2005 - 2015", @album.first.name + end + + it "can make call to spotify and return album music type", :vcr do + assert_equal "album", @album.first.type + end + end + + describe "Artist Info", :vcr do + before do + @artist_results = [{ + "id"=>"V0HY2FElJwADzFuK", + "food_id"=>"baja-bistro-seattle", + "music_id"=>"2KVkJsyOoELcQQNzC9ajLJ", + "music_type"=>"artist" + }] + + @artist = Music.get_music(@artist_results) + end + + it "can call to spotify and return the name of an artist", :vcr do + assert_equal "Franky & the Cheese", @artist.first.name + end + + it "can call to spotify and return artist as music type", :vcr do + assert_equal "artist", @artist.first.type + end + + end + + describe "Track Info", :vcr do + before do + @track_results = [{ + "id"=>"V0HY2FElJwADzFuR", + "food_id"=>"my-sweet-lil-cakes-seattle", + "music_id"=>"1RIw3X80k7wegvnIZ3bRzO", + "music_type"=>"track" + }] + + @track = Music.get_music(@track_results) + end + + it "can call to spotify and return the name of a track", :vcr do + assert_equal "Foolish Vacuity", @track.first.name + end + + it "can call to spotify and return track as music type", :vcr do + assert_equal "track", @track.first.type + end + end + + describe "Other Music Types", :vcr do + before do + @playlist_results = [{ + "id"=>"V0HY2FElJwADzFuR", + "food_id"=>"my-sweet-lil-cakes-seattle", + "music_id"=>"1RIw3X80k7wegvnIZ3bRzO", + "music_type"=>"playlist" + }] + + @playlist_music = Music.get_music(@playlist_results) + end + + it "will return empty string for other music types", :vcr do + assert_equal "", @playlist_music.first + end + end + end end \ No newline at end of file From f0673959b19ab77171310f81e60f12f8453321fe Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 22 May 2016 14:43:45 -0700 Subject: [PATCH 35/46] migration to add profile url to users table --- app/controllers/application_controller.rb | 5 ++--- app/views/layouts/application.html.erb | 2 +- .../20160522214236_add_user_colum_for_profile_url.rb | 5 +++++ db/schema.rb | 7 ++++--- 4 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 db/migrate/20160522214236_add_user_colum_for_profile_url.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 66bf3b2..cfb4d14 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,6 +1,4 @@ class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception helper_method :current_user @@ -8,5 +6,6 @@ class ApplicationController < ActionController::Base def current_user @current_user ||= User.find_by(id: session[:user_id]) end - + + end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 06ddabf..17893dd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -13,7 +13,7 @@ -
<%= yield %> diff --git a/app/views/shared/_suggestion.html.erb b/app/views/shared/_suggestion.html.erb index afd5ac0..c69c881 100644 --- a/app/views/shared/_suggestion.html.erb +++ b/app/views/shared/_suggestion.html.erb @@ -10,18 +10,18 @@ <% end %> <% end %> -
+

<%= link_to tune.name, tune.external_urls["spotify"], class: "body-links" %>
<%= tune.type.capitalize %>
-
+
<% nom = @food[index] %> <%= link_to nom.name, nom.url, class: "body-links" %>
<%= nom.location.display_address.join(" ") %>
P: <%= nom.display_phone %>
-
+
<%= image_tag nom.image_url, class: "food-img" %>
diff --git a/app/views/suggestions/index.html.erb b/app/views/suggestions/index.html.erb index 30a14be..27739ae 100644 --- a/app/views/suggestions/index.html.erb +++ b/app/views/suggestions/index.html.erb @@ -1,10 +1,12 @@ +
<% if current_user %> -

Enter a word or phrase to get a pairing!

+

Enter a food word to see pairings!

<%= form_tag search_path do %> - <%= text_field_tag(:term, class: "search-form") %> - <%= submit_tag("Search", class: "btn btn-info btn-lg") %> + <%= text_field_tag(:term) %> + <%= submit_tag("show me the tunes!", class: "btn btn-info btn-lg") %> <% end %> <% end %> +

Top 20 Pairings!

<%= render 'shared/suggestion' %> \ No newline at end of file diff --git a/app/views/suggestions/show.html.erb b/app/views/suggestions/show.html.erb index c2cc500..d8b8609 100644 --- a/app/views/suggestions/show.html.erb +++ b/app/views/suggestions/show.html.erb @@ -1,3 +1,3 @@ -

Pairings for <%= params[:term] %>

+

Pairings for <%= params[:term] %>


<%= render 'shared/suggestion' %> \ No newline at end of file From 8cd6e40956f710886c8c25f93d076aef09dd8534 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 22 May 2016 18:09:58 -0700 Subject: [PATCH 39/46] trying heroku --- ...fest-fd54c19640f6b35ff86c99e05763d4b3.json | 1 + ...780981055fb2292a7670046ce5f32be36e6cb2.css | 160 + ...981055fb2292a7670046ce5f32be36e6cb2.css.gz | Bin 0 -> 1084 bytes ...b4c079d407b66a510ab1a45f6b99223cb69ba66.js | 11605 ++++++++++++++++ ...079d407b66a510ab1a45f6b99223cb69ba66.js.gz | Bin 0 -> 92972 bytes ...f454dd7baed506755093562e46f7f881b017e6.jpg | Bin 0 -> 33062 bytes ...5f1662903461411fcbc43f7170057e79e302ce.png | Bin 0 -> 60368 bytes ...760c3ab1fd2e1f71c02031c4a441c0d949cb50.jpg | Bin 0 -> 6041 bytes 8 files changed, 11766 insertions(+) create mode 100644 public/assets/.sprockets-manifest-fd54c19640f6b35ff86c99e05763d4b3.json create mode 100644 public/assets/application-abe1642d61de9d9e08b1550de0780981055fb2292a7670046ce5f32be36e6cb2.css create mode 100644 public/assets/application-abe1642d61de9d9e08b1550de0780981055fb2292a7670046ce5f32be36e6cb2.css.gz create mode 100644 public/assets/application-cff130604891d628f85f77073b4c079d407b66a510ab1a45f6b99223cb69ba66.js create mode 100644 public/assets/application-cff130604891d628f85f77073b4c079d407b66a510ab1a45f6b99223cb69ba66.js.gz create mode 100644 public/assets/coffee-art-f1c0721028a3a4067b27f3fb31f454dd7baed506755093562e46f7f881b017e6.jpg create mode 100644 public/assets/notes-5f15a5e04385ae5c822283274b5f1662903461411fcbc43f7170057e79e302ce.png create mode 100644 public/assets/spotify_logo-e10f1175a662bc03951f9eee09760c3ab1fd2e1f71c02031c4a441c0d949cb50.jpg diff --git a/public/assets/.sprockets-manifest-fd54c19640f6b35ff86c99e05763d4b3.json b/public/assets/.sprockets-manifest-fd54c19640f6b35ff86c99e05763d4b3.json new file mode 100644 index 0000000..954f271 --- /dev/null +++ b/public/assets/.sprockets-manifest-fd54c19640f6b35ff86c99e05763d4b3.json @@ -0,0 +1 @@ +{"files":{"coffee-art-f1c0721028a3a4067b27f3fb31f454dd7baed506755093562e46f7f881b017e6.jpg":{"logical_path":"coffee-art.jpg","mtime":"2016-05-22T15:51:37-07:00","size":33062,"digest":"f1c0721028a3a4067b27f3fb31f454dd7baed506755093562e46f7f881b017e6","integrity":"sha256-8cByECijpAZ7J/P7MfRU3Xuu1QZ1UJNWLkb3+IGwF+Y="},"notes-5f15a5e04385ae5c822283274b5f1662903461411fcbc43f7170057e79e302ce.png":{"logical_path":"notes.png","mtime":"2016-05-22T15:46:43-07:00","size":60368,"digest":"5f15a5e04385ae5c822283274b5f1662903461411fcbc43f7170057e79e302ce","integrity":"sha256-XxWl4EOFrlyCIoMnS18WYpA0YUEfy8Q/cXAFfnnjAs4="},"spotify_logo-e10f1175a662bc03951f9eee09760c3ab1fd2e1f71c02031c4a441c0d949cb50.jpg":{"logical_path":"spotify_logo.jpg","mtime":"2016-05-19T10:51:34-07:00","size":6041,"digest":"e10f1175a662bc03951f9eee09760c3ab1fd2e1f71c02031c4a441c0d949cb50","integrity":"sha256-4Q8RdaZivAOVH57uCXYMOrH9Lh9xwCAxxKRBwNlJy1A="},"application-cff130604891d628f85f77073b4c079d407b66a510ab1a45f6b99223cb69ba66.js":{"logical_path":"application.js","mtime":"2016-05-22T15:52:13-07:00","size":316490,"digest":"cff130604891d628f85f77073b4c079d407b66a510ab1a45f6b99223cb69ba66","integrity":"sha256-z/EwYEiR1ij4X3cHO0wHnUB7ZqUQqxpF9rmSI8tpumY="},"application-abe1642d61de9d9e08b1550de0780981055fb2292a7670046ce5f32be36e6cb2.css":{"logical_path":"application.css","mtime":"2016-05-22T18:00:33-07:00","size":2541,"digest":"abe1642d61de9d9e08b1550de0780981055fb2292a7670046ce5f32be36e6cb2","integrity":"sha256-q+FkLWHenZ4IsVUN4HgJgQVfsikqdnAEbOXzK+NubLI="}},"assets":{"coffee-art.jpg":"coffee-art-f1c0721028a3a4067b27f3fb31f454dd7baed506755093562e46f7f881b017e6.jpg","notes.png":"notes-5f15a5e04385ae5c822283274b5f1662903461411fcbc43f7170057e79e302ce.png","spotify_logo.jpg":"spotify_logo-e10f1175a662bc03951f9eee09760c3ab1fd2e1f71c02031c4a441c0d949cb50.jpg","application.js":"application-cff130604891d628f85f77073b4c079d407b66a510ab1a45f6b99223cb69ba66.js","application.css":"application-abe1642d61de9d9e08b1550de0780981055fb2292a7670046ce5f32be36e6cb2.css"}} \ No newline at end of file diff --git a/public/assets/application-abe1642d61de9d9e08b1550de0780981055fb2292a7670046ce5f32be36e6cb2.css b/public/assets/application-abe1642d61de9d9e08b1550de0780981055fb2292a7670046ce5f32be36e6cb2.css new file mode 100644 index 0000000..89169f2 --- /dev/null +++ b/public/assets/application-abe1642d61de9d9e08b1550de0780981055fb2292a7670046ce5f32be36e6cb2.css @@ -0,0 +1,160 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + + + */ + + +* { + font-family: 'The Girl Next Door', cursive; + letter-spacing: 1.5px; + color: #ffffff; +} + + body:after { + content: ""; + position: fixed; + top: 0; + left: 0; + background-color: #00004d; + width: 100%; + height: 100%; + z-index: -1; + background-size: cover; + background-repeat: no-repeat; + background-attachment: fixed; +} + + +h3.sub-headings { + text-align: center; + font-family: 'The Girl Next Door', cursive; + font-weight: bold; + color: #ffffff; +} + +.brand { + float: left; + padding-bottom: 2%; + padding-left: 2%; +} + +h1.title { + font-weight: bolder; + font-size: 30px; + color: #ffffff; + +} + +.brand-img { + height: 90px; + width: 90px; + opacity: 0.8; + border-radius: 50%; + float: left; + margin-top: 1%; +} + +.music-food { + transform: translateY(16%); +} + +.fav-button { + transform: translateY(150%); +} + +.food-img { + border-radius: 25%; + height: 150px; + width: 150px; +} + +.header-links { + color: #2eb82e; +} + +.body-links { + text-decoration: none; + font-size: 16px; + color: #2eb82e; + font-weight: bold; +} + + +.body-links:hover { + color: #ffffff; +} + +header { + height: 130px; + width: 100%; + padding: 1% 2% 0 2%; +} + +ul.nav-top li { + display: inline; + padding-right: 5px; + list-style: none; + font-size: 18px; + font-weight: bold; +} + +li.logged-in { + padding-top: 10px; + margin-top: -1.5%; +} + +div.header { + float: right; + display: inline; + margin-top: 2%; + padding-right: 1%; + font-weight: bolder; + font-size: 15px; +} + +.logo { + height: 50px; + width: 50px; + border-radius: 50%; + margin-top: -12%; +} + +p.header-spotify { + font-size: 16px; + font-style: italic; + margin-top: 2%; + padding-left: 15%; + color: green; +} + +.row { + background-color: rgba(177, 177, 205, 0.4); + border-radius: 25px; + padding: 1%; +} + +.search-form { + text-align: center; +} + +input[type="text"] { + height: 4em; + width: 20em; + margin-top: 2%; + margin-bottom: 2%; + border-style: solid; + color: #000000; + text-align: center; +} + diff --git a/public/assets/application-abe1642d61de9d9e08b1550de0780981055fb2292a7670046ce5f32be36e6cb2.css.gz b/public/assets/application-abe1642d61de9d9e08b1550de0780981055fb2292a7670046ce5f32be36e6cb2.css.gz new file mode 100644 index 0000000000000000000000000000000000000000..6d7f0c38b57bc4689fc433c5e354b955fcf114af GIT binary patch literal 1084 zcmV-C1jG9uiwFQQRzg<-1C>?5ZsRr-JjY-0kRr%#U@4Xp@1`<(C|aQCrI+kwQS?Ab zlthFk1(J&64ffx6NJ_TsI7J%-21z}>H#2WY-rmgUhQ74I68;%&m=ZO&j%pz}xt6(W zDXHL8>P?5GiiC2SSl3BWGAFc3OKaz}ZAIDARv=iYQuY-mhOujT$YgyLDXc?+f=j(k zvEbK!RXh6a@sXIS=+O^C-K}t~P}mJjl`y>Hu3?fcP(QdBbKNgG~s!&M2?Ee6zEp&F=UxCHlSP91aYNad^UuMtxl z4&fkCRZV3|wgQ^OYW{QJ7RY+)&}rv|#s!gbB>kmCNLS0f1lB8 z*50MIFOrtC3es3l`NBcOgh|nWWr-c3*#A;|h~5sw3N1bFb8@GJ@z(YomD&^V8lq(# zTna!*bazh6tI1;2*)JhOo25=TIAwIjw5o?5SEF=y3pD<1-w#LVjxYG?TiZZFSuA=HFZ)wa0Me9m$*kT&_I8z3Wy-6o;u#;Z1>UQm7|yjJ;}0 zUOX)M&_0}&Lqu>+#Y=5iJS0jhe%yiV(@_V;T;~jf{L=z?8!o8Vv&S}Kopvs}JLVM* z*JvT%1sI4Hql<{E Cydwbs literal 0 HcmV?d00001 diff --git a/public/assets/application-cff130604891d628f85f77073b4c079d407b66a510ab1a45f6b99223cb69ba66.js b/public/assets/application-cff130604891d628f85f77073b4c079d407b66a510ab1a45f6b99223cb69ba66.js new file mode 100644 index 0000000..744064b --- /dev/null +++ b/public/assets/application-cff130604891d628f85f77073b4c079d407b66a510ab1a45f6b99223cb69ba66.js @@ -0,0 +1,11605 @@ +/*! + * jQuery JavaScript Library v1.12.1 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-22T19:07Z + */ + + +(function( global, factory ) { + + if ( typeof module === "object" && typeof module.exports === "object" ) { + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Support: Firefox 18+ +// Can't be in strict mode, several libs including ASP.NET trace +// the stack via arguments.caller.callee and Firefox dies if +// you try to trace through "use strict" call chains. (#13335) +//"use strict"; +var deletedIds = []; + +var document = window.document; + +var slice = deletedIds.slice; + +var concat = deletedIds.concat; + +var push = deletedIds.push; + +var indexOf = deletedIds.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var support = {}; + + + +var + version = "1.12.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android<4.1, IE<9 + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // Start with an empty selector + selector: "", + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num != null ? + + // Return just the one element from the set + ( num < 0 ? this[ num + this.length ] : this[ num ] ) : + + // Return all the elements in a clean array + slice.call( this ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + ret.context = this.context; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: deletedIds.sort, + splice: deletedIds.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var src, copyIsArray, copy, name, options, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = jQuery.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type( obj ) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type( obj ) === "array"; + }, + + isWindow: function( obj ) { + /* jshint eqeqeq: false */ + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + + // parseFloat NaNs numeric-cast false positives (null|true|false|"") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + // adding 1 corrects loss of precision from parseFloat (#15100) + var realStringObj = obj && obj.toString(); + return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + isPlainObject: function( obj ) { + var key; + + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call( obj, "constructor" ) && + !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { + return false; + } + } catch ( e ) { + + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Support: IE<9 + // Handle iteration over inherited properties before own properties. + if ( !support.ownFirst ) { + for ( key in obj ) { + return hasOwn.call( obj, key ); + } + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; + }, + + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && jQuery.trim( data ) ) { + + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android<4.1, IE<9 + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + var len; + + if ( arr ) { + if ( indexOf ) { + return indexOf.call( arr, elem, i ); + } + + len = arr.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + + // Skip accessing in sparse arrays + if ( i in arr && arr[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + while ( j < len ) { + first[ i++ ] = second[ j++ ]; + } + + // Support: IE<9 + // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) + if ( len !== len ) { + while ( second[ j ] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var args, proxy, tmp; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: function() { + return +( new Date() ); + }, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +// JSHint would error on this code due to the Symbol not being defined in ES5. +// Defining this global in .jshintrc would create a danger of using the global +// unguarded in another place, it seems safer to just disable JSHint for these +// three lines. +/* jshint ignore: start */ +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ]; +} +/* jshint ignore: end */ + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: iOS 8.2 (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.2.1 + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2015-10-17 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // General-purpose constants + MAX_NEGATIVE = 1 << 31, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // http://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + rescape = /'|\\/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, nidselect, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; + while ( i-- ) { + groups[i] = nidselect + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + ( ~b.sourceIndex || MAX_NEGATIVE ) - + ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, parent, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( (parent = document.defaultView) && parent.top !== parent ) { + // Support: IE 11 + if ( parent.addEventListener ) { + parent.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( parent.attachEvent ) { + parent.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( div ) { + div.className = "i"; + return !div.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( document.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( div ) { + docElem.appendChild( div ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID find and filter + if ( support.getById ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var m = context.getElementById( id ); + return m ? [ m ] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + // Support: IE6/7 + // getElementById is not reliable as a find shortcut + delete Expr.find["ID"]; + + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See http://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + docElem.appendChild( div ).innerHTML = "
" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( div.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibing-combinator selector` fails + if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( div ) { + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + div.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( div.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( (oldCache = uniqueCache[ dir ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ dir ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + support.getById && context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( div1 ) { + // Should return 1, but returns 4 (following) + return div1.compareDocumentPosition( document.createElement("div") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( div ) { + div.innerHTML = ""; + return div.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( div ) { + div.innerHTML = ""; + div.firstChild.setAttribute( "value", "" ); + return div.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( div ) { + return div.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + +var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + /* jshint -W018 */ + return !!qualifier.call( elem, i, elem ) !== not; + } ); + + } + + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + + } + + if ( typeof qualifier === "string" ) { + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + qualifier = jQuery.filter( qualifier, elements ); + } + + return jQuery.grep( elements, function( elem ) { + return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not; + } ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 && elem.nodeType === 1 ? + jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : + jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, + ret = [], + self = this, + len = self.length; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // init accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector.charAt( 0 ) === "<" && + selector.charAt( selector.length - 1 ) === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[ 2 ] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[ 0 ] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return typeof root.ready !== "undefined" ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var i, + targets = jQuery( target, this ), + len = targets.length; + + return this.filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( pos ? + pos.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[ 0 ], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem, this ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + ret = jQuery.uniqueSort( ret ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + } + + return this.pushStack( ret ); + }; +} ); +var rnotwhite = ( /\S+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( jQuery.isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = true; + if ( !memory ) { + self.disable(); + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], + [ "notify", "progress", jQuery.Callbacks( "memory" ) ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this === promise ? newDefer.promise() : this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( function() { + + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || + ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. + // If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( values === progressValues ) { + deferred.notifyWith( contexts, values ); + + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .progress( updateFunc( i, progressContexts, progressValues ) ) + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ); + } else { + --remaining; + } + } + } + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +} ); + + +// The deferred used on DOM ready +var readyList; + +jQuery.fn.ready = function( fn ) { + + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + jQuery( document ).off( "ready" ); + } + } +} ); + +/** + * Clean-up method for dom ready events + */ +function detach() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + + } else { + document.detachEvent( "onreadystatechange", completed ); + window.detachEvent( "onload", completed ); + } +} + +/** + * The ready event handler and self cleanup method + */ +function completed() { + + // readyState === "complete" is good enough for us to call the dom ready in oldIE + if ( document.addEventListener || + window.event.type === "load" || + document.readyState === "complete" ) { + + detach(); + jQuery.ready(); + } +} + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called + // after the browser event has already occurred. + // Support: IE6-10 + // Older IE sometimes signals "interactive" too soon + if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); + + // If IE event model is used + } else { + + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", completed ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", completed ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch ( e ) {} + + if ( top && top.doScroll ) { + ( function doScrollCheck() { + if ( !jQuery.isReady ) { + + try { + + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll( "left" ); + } catch ( e ) { + return window.setTimeout( doScrollCheck, 50 ); + } + + // detach all dom ready events + detach(); + + // and execute any waiting functions + jQuery.ready(); + } + } )(); + } + } + } + return readyList.promise( obj ); +}; + +// Kick off the DOM ready check even if the user does not +jQuery.ready.promise(); + + + + +// Support: IE<9 +// Iteration over object's inherited properties before its own +var i; +for ( i in jQuery( support ) ) { + break; +} +support.ownFirst = i === "0"; + +// Note: most support tests are defined in their respective modules. +// false until the test is run +support.inlineBlockNeedsLayout = false; + +// Execute ASAP in case we need to set body.style.zoom +jQuery( function() { + + // Minified: var a,b,c,d + var val, div, body, container; + + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { + + // Return for frameset docs that don't have a body + return; + } + + // Setup + div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + body.appendChild( container ).appendChild( div ); + + if ( typeof div.style.zoom !== "undefined" ) { + + // Support: IE<8 + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; + + support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; + if ( val ) { + + // Prevent IE 6 from affecting layout for positioned elements #11048 + // Prevent IE from shrinking the body in IE 7 mode #12869 + // Support: IE<8 + body.style.zoom = 1; + } + } + + body.removeChild( container ); +} ); + + +( function() { + var div = document.createElement( "div" ); + + // Support: IE<9 + support.deleteExpando = true; + try { + delete div.test; + } catch ( e ) { + support.deleteExpando = false; + } + + // Null elements to avoid leaks in IE. + div = null; +} )(); +var acceptData = function( elem ) { + var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ], + nodeType = +elem.nodeType || 1; + + // Do not set data on non-element DOM nodes because it will not be cleared (#8335). + return nodeType !== 1 && nodeType !== 9 ? + false : + + // Nodes accept data unless otherwise specified; rejection can be conditional + !noData || noData !== true && elem.getAttribute( "classid" ) === noData; +}; + + + + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /([A-Z])/g; + +function dataAttr( elem, key, data ) { + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + var name; + for ( name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + +function internalData( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !acceptData( elem ) ) { + return; + } + + var ret, thisCache, + internalKey = jQuery.expando, + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) && + data === undefined && typeof name === "string" ) { + return; + } + + if ( !id ) { + + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + + // Avoid exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( typeof name === "string" ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; +} + +function internalRemoveData( elem, name, pvt ) { + if ( !acceptData( elem ) ) { + return; + } + + var thisCache, i, + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split( " " ); + } + } + } else { + + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = name.concat( jQuery.map( name, jQuery.camelCase ) ); + } + + i = name.length; + while ( i-- ) { + delete thisCache[ name[ i ] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject( cache[ id ] ) ) { + return; + } + } + + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + /* jshint eqeqeq: false */ + } else if ( support.deleteExpando || cache != cache.window ) { + /* jshint eqeqeq: true */ + delete cache[ id ]; + + // When all else fails, undefined + } else { + cache[ id ] = undefined; + } +} + +jQuery.extend( { + cache: {}, + + // The following elements (space-suffixed to avoid Object.prototype collisions) + // throw uncatchable exceptions if you attempt to set expando properties + noData: { + "applet ": true, + "embed ": true, + + // ...but Flash objects (which have this classid) *can* handle expandos + "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data ) { + return internalData( elem, name, data ); + }, + + removeData: function( elem, name ) { + return internalRemoveData( elem, name ); + }, + + // For internal use only. + _data: function( elem, name, data ) { + return internalData( elem, name, data, true ); + }, + + _removeData: function( elem, name ) { + return internalRemoveData( elem, name, true ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Special expections of .data basically thwart jQuery.access, + // so implement the relevant behavior ourselves + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE11+ + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + jQuery.data( this, key ); + } ); + } + + return arguments.length > 1 ? + + // Sets one value + this.each( function() { + jQuery.data( this, key, value ); + } ) : + + // Gets one value + // Try to fetch any internally stored data first + elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; + }, + + removeData: function( key ) { + return this.each( function() { + jQuery.removeData( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray( data ) ) { + queue = jQuery._data( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // not intended for public consumption - generates a queueHooks object, + // or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + jQuery._removeData( elem, type + "queue" ); + jQuery._removeData( elem, key ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); + + +( function() { + var shrinkWrapBlocksVal; + + support.shrinkWrapBlocks = function() { + if ( shrinkWrapBlocksVal != null ) { + return shrinkWrapBlocksVal; + } + + // Will be changed later if needed. + shrinkWrapBlocksVal = false; + + // Minified: var b,c,d + var div, body, container; + + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body || !body.style ) { + + // Test fired too early or in an unsupported environment, exit. + return; + } + + // Setup + div = document.createElement( "div" ); + container = document.createElement( "div" ); + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; + body.appendChild( container ).appendChild( div ); + + // Support: IE6 + // Check if elements with layout shrink-wrap their children + if ( typeof div.style.zoom !== "undefined" ) { + + // Reset CSS: box-sizing; display; margin; border + div.style.cssText = + + // Support: Firefox<29, Android 2.3 + // Vendor-prefix box-sizing + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + + "box-sizing:content-box;display:block;margin:0;border:0;" + + "padding:1px;width:1px;zoom:1"; + div.appendChild( document.createElement( "div" ) ).style.width = "5px"; + shrinkWrapBlocksVal = div.offsetWidth !== 3; + } + + body.removeChild( container ); + + return shrinkWrapBlocksVal; + }; + +} )(); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHidden = function( elem, el ) { + + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || + !jQuery.contains( elem.ownerDocument, elem ); + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween ? + function() { return tween.cur(); } : + function() { return jQuery.css( elem, prop, "" ); }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + do { + + // If previous iteration zeroed out, double until we get *something*. + // Use string for doubling so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + initialInUnit = initialInUnit / scale; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // Break the loop if scale is unchanged or perfect, or if we've just had enough. + } while ( + scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations + ); + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + length = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < length; i++ ) { + fn( + elems[ i ], + key, + raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[ 0 ], key ) : emptyGet; +}; +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([\w:-]+)/ ); + +var rscriptType = ( /^$|\/(?:java|ecma)script/i ); + +var rleadingWhitespace = ( /^\s+/ ); + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + + "details|dialog|figcaption|figure|footer|header|hgroup|main|" + + "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; + + + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + + +( function() { + var div = document.createElement( "div" ), + fragment = document.createDocumentFragment(), + input = document.createElement( "input" ); + + // Setup + div.innerHTML = "
a"; + + // IE strips leading whitespace when .innerHTML is used + support.leadingWhitespace = div.firstChild.nodeType === 3; + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + support.tbody = !div.getElementsByTagName( "tbody" ).length; + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + support.html5Clone = + document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + input.type = "checkbox"; + input.checked = true; + fragment.appendChild( input ); + support.appendChecked = input.checked; + + // Make sure textarea (and checkbox) defaultValue is properly cloned + // Support: IE6-IE11+ + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // #11217 - WebKit loses check when the name is after the checked attribute + fragment.appendChild( div ); + + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input = document.createElement( "input" ); + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 + // old WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<9 + // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ + support.noCloneEvent = !!div.addEventListener; + + // Support: IE<9 + // Since attributes and properties are the same in IE, + // cleanData must set properties to undefined rather than use removeAttribute + div[ jQuery.expando ] = 1; + support.attributes = !div.getAttribute( jQuery.expando ); +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + area: [ 1, "", "" ], + + // Support: IE8 + param: [ 1, "", "" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + col: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, + // unless wrapped in a div with non-breaking characters in front of it. + _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] +}; + +// Support: IE8-IE9 +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + var elems, elem, + i = 0, + found = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== "undefined" ? + context.querySelectorAll( tag || "*" ) : + undefined; + + if ( !found ) { + for ( found = [], elems = context.childNodes || context; + ( elem = elems[ i ] ) != null; + i++ + ) { + if ( !tag || jQuery.nodeName( elem, tag ) ) { + found.push( elem ); + } else { + jQuery.merge( found, getAll( elem, tag ) ); + } + } + } + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], found ) : + found; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var elem, + i = 0; + for ( ; ( elem = elems[ i ] ) != null; i++ ) { + jQuery._data( + elem, + "globalEval", + !refElements || jQuery._data( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/, + rtbody = / from table fragments + if ( !support.tbody ) { + + // String was a , *may* have spurious + elem = tag === "table" && !rtbody.test( elem ) ? + tmp.firstChild : + + // String was a bare or + wrap[ 1 ] === "
" && !rtbody.test( elem ) ? + tmp : + 0; + + j = elem && elem.childNodes.length; + while ( j-- ) { + if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && + !tbody.childNodes.length ) { + + elem.removeChild( tbody ); + } + } + } + + jQuery.merge( nodes, tmp.childNodes ); + + // Fix #12392 for WebKit and IE > 9 + tmp.textContent = ""; + + // Fix #12392 for oldIE + while ( tmp.firstChild ) { + tmp.removeChild( tmp.firstChild ); + } + + // Remember the top-level container for proper cleanup + tmp = safe.lastChild; + } + } + } + + // Fix #11356: Clear elements from fragment + if ( tmp ) { + safe.removeChild( tmp ); + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !support.appendChecked ) { + jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); + } + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( safe.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + tmp = null; + + return safe; +} + + +( function() { + var i, eventName, + div = document.createElement( "div" ); + + // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) + for ( i in { submit: true, change: true, focusin: true } ) { + eventName = "on" + i; + + if ( !( support[ i ] = eventName in window ) ) { + + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) + div.setAttribute( eventName, "t" ); + support[ i ] = div.attributes[ eventName ].expando === false; + } + } + + // Null elements to avoid leaks in IE. + div = null; +} )(); + + +var rformElems = /^(?:input|select|textarea)$/i, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE9 +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + var tmp, events, t, handleObjIn, + special, eventHandle, handleObj, + handlers, type, namespaces, origType, + elemData = jQuery._data( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && + ( !e || jQuery.event.triggered !== e.type ) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + + // Add elem as a property of the handle fn to prevent a memory leak + // with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + var j, handleObj, tmp, + origCount, t, events, + special, handlers, type, + namespaces, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery._removeData( elem, "events" ); + } + }, + + trigger: function( event, data, elem, onlyHandlers ) { + var handle, ontype, cur, + bubbleType, special, tmp, i, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && + jQuery._data( cur, "handle" ); + + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( + ( !special._default || + special._default.apply( eventPath.pop(), data ) === false + ) && acceptData( elem ) + ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + try { + elem[ type ](); + } catch ( e ) { + + // IE<9 dies on focus/blur to hidden element (#1486,#12518) + // only reproducible on winXP IE8 native, not IE9 in IE8 mode + } + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, j, ret, matched, handleObj, + handlerQueue = [], + args = slice.call( arguments ), + handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, matches, sel, handleObj, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Support (at least): Chrome, IE9 + // Find delegate handlers + // Black-hole SVG instance trees (#13180) + // + // Support: Firefox<=42+ + // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) + if ( delegateCount && cur.nodeType && + ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { + + /* jshint eqeqeq: false */ + for ( ; cur != this; cur = cur.parentNode || this ) { + /* jshint eqeqeq: true */ + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push( { elem: cur, handlers: matches } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: IE<9 + // Fix target property (#1925) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Support: Safari 6-8+ + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Support: IE<9 + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) + event.metaKey = !!event.metaKey; + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + + "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split( " " ), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: ( "button buttons clientX clientY fromElement offsetX offsetY " + + "pageX pageY screenX screenY toElement" ).split( " " ), + filter: function( event, original ) { + var body, eventDoc, doc, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - + ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - + ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? + original.toElement : + fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + try { + this.focus(); + return false; + } catch ( e ) { + + // Support: IE<9 + // If we error on focus to hidden element (#1486, #12518), + // let .trigger() run the handlers + } + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return jQuery.nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + }, + + // Piggyback on a donor event to simulate a different one + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + + // Previously, `originalEvent: {}` was set here, so stopPropagation call + // would not be triggered on donor event, since in our own + // jQuery.event.stopPropagation function we had a check for existence of + // originalEvent.stopPropagation method, so, consequently it would be a noop. + // + // Guard for simulated events was moved to jQuery.event.stopPropagation function + // since `originalEvent` should point to the original event for the + // constancy with other events and for more focused logic + } + ); + + jQuery.event.trigger( e, null, elem ); + + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } + } : + function( elem, type, handle ) { + var name = "on" + type; + + if ( elem.detachEvent ) { + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 + // detachEvent needed property on element, by name of that event, + // to properly expose it to GC + if ( typeof elem[ name ] === "undefined" ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); + } + }; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: IE < 9, Android < 4.0 + src.returnValue === false ? + returnTrue : + returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + if ( !e ) { + return; + } + + // If preventDefault exists, run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // Support: IE + // Otherwise set the returnValue property of the original event to false + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( !e || this.isSimulated ) { + return; + } + + // If stopPropagation exists, run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + + // Support: IE + // Set the cancelBubble property of the original event to true + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && e.stopImmediatePropagation ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://code.google.com/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +// IE submit delegation +if ( !support.submit ) { + + jQuery.event.special.submit = { + setup: function() { + + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? + + // Support: IE <=8 + // We use jQuery.prop instead of elem.form + // to allow fixing the IE8 delegated submit issue (gh-2332) + // by 3rd party polyfills/workarounds. + jQuery.prop( elem, "form" ) : + undefined; + + if ( form && !jQuery._data( form, "submit" ) ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submitBubble = true; + } ); + jQuery._data( form, "submit", true ); + } + } ); + + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + + // If form was submitted by the user, bubble the event up the tree + if ( event._submitBubble ) { + delete event._submitBubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event ); + } + } + }, + + teardown: function() { + + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !support.change ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._justChanged = true; + } + } ); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._justChanged && !event.isTrigger ) { + this._justChanged = false; + } + + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event ); + } ); + } + return false; + } + + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event ); + } + } ); + jQuery._data( elem, "change", true ); + } + } ); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || + ( elem.type !== "radio" && elem.type !== "checkbox" ) ) { + + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return !rformElems.test( this.nodeName ); + } + }; +} + +// Support: Firefox +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome, Safari +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = jQuery._data( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = jQuery._data( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + jQuery._removeData( doc, fix ); + } else { + jQuery._data( doc, fix, attaches ); + } + } + }; + } ); +} + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + }, + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, + rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ), + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, + + // Support: IE 10-11, Edge 10240+ + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g, + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) ); + +// Support: IE<8 +// Manipulating tables requires a tbody +function manipulationTarget( elem, content ) { + return jQuery.nodeName( elem, "table" ) && + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + + elem.getElementsByTagName( "tbody" )[ 0 ] || + elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : + elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + if ( match ) { + elem.type = match[ 1 ]; + } else { + elem.removeAttribute( "type" ); + } + return elem; +} + +function cloneCopyEvent( src, dest ) { + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { + return; + } + + var type, i, l, + oldData = jQuery._data( src ), + curData = jQuery._data( dest, oldData ), + events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + + // make the cloned public data object a copy from the original + if ( curData.data ) { + curData.data = jQuery.extend( {}, curData.data ); + } +} + +function fixCloneNodeIssues( src, dest ) { + var nodeName, e, data; + + // We do not need to do anything for non-Elements + if ( dest.nodeType !== 1 ) { + return; + } + + nodeName = dest.nodeName.toLowerCase(); + + // IE6-8 copies events bound via attachEvent when using cloneNode. + if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { + data = jQuery._data( dest ); + + for ( e in data.events ) { + jQuery.removeEvent( dest, e, data.handle ); + } + + // Event data gets referenced instead of copied if the expando gets copied too + dest.removeAttribute( jQuery.expando ); + } + + // IE blanks contents when cloning scripts, and tries to evaluate newly-set text + if ( nodeName === "script" && dest.text !== src.text ) { + disableScript( dest ).text = src.text; + restoreScript( dest ); + + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + } else if ( nodeName === "object" ) { + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) { + dest.innerHTML = src.innerHTML; + } + + } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + + // IE6-8 fails to persist the checked state of a cloned checkbox + // or radio button. Worse, IE6-7 fail to give the cloned element + // a checked appearance if the defaultChecked value isn't also set + + dest.defaultChecked = dest.checked = src.checked; + + // IE6-7 get confused and end up setting the value of a cloned + // checkbox/radio button to an empty string instead of "on" + if ( dest.value !== src.value ) { + dest.value = src.value; + } + + // IE6-8 fails to return the selected option to the default selected + // state when cloning options + } else if ( nodeName === "option" ) { + dest.defaultSelected = dest.selected = src.defaultSelected; + + // IE6-8 fails to set the defaultValue to the correct value when + // cloning other types of input fields + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var first, node, hasScripts, + scripts, doc, fragment, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android<4.1, PhantomJS<2 + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !jQuery._data( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + jQuery.globalEval( + ( node.text || node.textContent || node.innerHTML || "" ) + .replace( rcleanScript, "" ) + ); + } + } + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + elems = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = elems[ i ] ) != null; i++ ) { + + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var destElements, node, clone, i, srcElements, + inPage = jQuery.contains( elem.ownerDocument, elem ); + + if ( support.html5Clone || jQuery.isXMLDoc( elem ) || + !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } + + if ( ( !support.noCloneEvent || !support.noCloneChecked ) && + ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + // Fix all IE cloning issues + for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) { + + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[ i ] ) { + fixCloneNodeIssues( node, destElements[ i ] ); + } + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) { + cloneCopyEvent( node, destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + destElements = srcElements = node = null; + + // Return the cloned set + return clone; + }, + + cleanData: function( elems, /* internal */ forceAcceptData ) { + var elem, type, id, data, + i = 0, + internalKey = jQuery.expando, + cache = jQuery.cache, + attributes = support.attributes, + special = jQuery.event.special; + + for ( ; ( elem = elems[ i ] ) != null; i++ ) { + if ( forceAcceptData || acceptData( elem ) ) { + + id = elem[ internalKey ]; + data = id && cache[ id ]; + + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Remove cache only if it was not already removed by jQuery.event.remove + if ( cache[ id ] ) { + + delete cache[ id ]; + + // Support: IE<9 + // IE does not allow us to delete expando properties from nodes + // IE creates expando attributes along with the property + // IE does not have a removeAttribute function on Document nodes + if ( !attributes && typeof elem.removeAttribute !== "undefined" ) { + elem.removeAttribute( internalKey ); + + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://code.google.com/p/chromium/issues/detail?id=378607 + } else { + elem[ internalKey ] = undefined; + } + + deletedIds.push( id ); + } + } + } + } + } +} ); + +jQuery.fn.extend( { + + // Keep domManip exposed until 3.0 (gh-2225) + domManip: domManip, + + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().append( + ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) + ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + + // If this is a select, ensure that it displays empty (#12336) + // Support: IE<9 + if ( elem.options && jQuery.nodeName( elem, "select" ) ) { + elem.options.length = 0; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined ) { + return elem.nodeType === 1 ? + elem.innerHTML.replace( rinlinejQuery, "" ) : + undefined; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( support.htmlSerialize || !rnoshimcache.test( value ) ) && + ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + + // Remove element nodes and prevent memory leaks + elem = this[ i ] || {}; + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + i = 0, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); + + +var iframe, + elemdisplay = { + + // Support: Firefox + // We have to pre-define these values for FF (#10227) + HTML: "block", + BODY: "block" + }; + +/** + * Retrieve the actual display of a element + * @param {String} name nodeName of the element + * @param {Object} doc Document object + */ + +// Called only from within defaultDisplay +function actualDisplay( name, doc ) { + var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + + display = jQuery.css( elem[ 0 ], "display" ); + + // We don't have any data stored on the element, + // so use "detach" method as fast way to get rid of the element + elem.detach(); + + return display; +} + +/** + * Try to determine the default display value of an element + * @param {String} nodeName + */ +function defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + + // Use the already-created iframe if possible + iframe = ( iframe || jQuery( "
<%= link_to tune.name, tune.external_urls["spotify"], class: "body-links" %>
<%= tune.type.capitalize %>
-
+
<% nom = @food[index] %> <%= link_to nom.name, nom.url, class: "body-links" %>
<%= nom.location.display_address.join(" ") %>
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 817a18b..8f1aab5 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,14 +1,3 @@ Rails.application.config.middleware.use OmniAuth::Builder do provider :spotify, ENV["SPOTIFY_CLIENT_ID"], ENV["SPOTIFY_CLIENT_SECRET"] - -# OmniAuth.config.test_mode = true -# known_user = { 'provider' => 'spotify', -# 'uid' => '12345', -# 'info' => { -# 'name' => 'person', -# 'id' => '9999' -# } -# } - -# OmniAuth.config.add_mock(:spotify, known_user) end \ No newline at end of file From 4d7d066bb2cf70c695edbdea290ef3575fd05213 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 23 May 2016 12:22:37 -0700 Subject: [PATCH 45/46] migration --- db/migrate/20160517231850_add_user_columns.rb | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 db/migrate/20160517231850_add_user_columns.rb diff --git a/db/migrate/20160517231850_add_user_columns.rb b/db/migrate/20160517231850_add_user_columns.rb deleted file mode 100644 index b7f42b1..0000000 --- a/db/migrate/20160517231850_add_user_columns.rb +++ /dev/null @@ -1,7 +0,0 @@ -class AddUserColumns < ActiveRecord::Migration - def change - add_column :users, :provider, :string, null: false - add_column :users, :uid, :string, null: false - add_column :users, :name, :string - end -end From 8c23dcabc868c12d11e74e10c3b80b7df526cd97 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 12 Jul 2016 16:54:59 -0700 Subject: [PATCH 46/46] updating readme with link to finished app --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a0837e0..91c064f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# Final App: https://food-tunes.herokuapp.com/ + # Tunes and Takeout This is a Rails project designed for students to gain experience building websites that make use of 3rd-party *web services- through *web APIs*.