diff --git a/.gitignore b/.gitignore index 03f3ce7..882d639 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,5 @@ build-iPhoneSimulator/ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc + +/.env diff --git a/Gemfile b/Gemfile index 288bb87..5607d5f 100644 --- a/Gemfile +++ b/Gemfile @@ -16,11 +16,21 @@ gem 'coffee-rails', '~> 4.1.0' # Use jquery as the JavaScript library gem 'jquery-rails' +gem 'turbolinks' # 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 'sdoc', '~> 0.4.0', group: :doc +gem 'httparty', '0.13.7' +# gem 'yelp', require: 'yelp' +gem 'yelp', '~> 2.1', '>= 2.1.2' +gem 'rspotify', '1.10.0' + +gem 'omniauth' +#gem 'omniauth-github' +gem 'omniauth-oauth2', '~> 1.3.1' +gem 'addressable' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' @@ -32,14 +42,26 @@ gem 'sdoc', '~> 0.4.0', group: :doc group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console - gem 'byebug' + gem 'byebug', '8.2.5' + gem "pry-rails", '0.3.4' + gem 'simplecov', '0.11.2' + gem 'minitest-vcr' + # gem 'vcr' + gem 'minitest-reporters' + gem 'webmock', '2.0.2' + gem 'dotenv-rails' + end group :development do # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '~> 2.0' + gem "better_errors" # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - gem 'spring' + # gem 'spring' end +group :production do + gem 'rails_12factor' +end diff --git a/Gemfile.lock b/Gemfile.lock index 6ff0f39..086d704 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,11 +36,18 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + addressable (2.4.0) + ansi (1.5.0) arel (6.0.3) + better_errors (2.1.1) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) builder (3.2.2) byebug (8.2.5) + coderay (1.1.1) coffee-rails (4.1.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.1.x) @@ -49,11 +56,27 @@ GEM execjs coffee-script-source (1.10.0) concurrent-ruby (1.0.2) + crack (0.4.3) + safe_yaml (~> 1.0.0) 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) + multipart-post (>= 1.2, < 3) + faraday_middleware (0.10.0) + faraday (>= 0.7.4, < 0.10) globalid (0.3.6) activesupport (>= 4.1.0) + hashdiff (0.3.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,19 +86,53 @@ 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) mime-types (>= 1.16, < 4) + method_source (0.8.2) mime-types (3.0) mime-types-data (~> 3.2015) mime-types-data (3.2016.0221) mini_portile2 (2.0.0) + minispec-metadata (2.0.0) + minitest minitest (5.8.4) + minitest-reporters (1.1.9) + ansi + builder + minitest (>= 5.0) + ruby-progressbar + minitest-vcr (1.4.0) + minispec-metadata (~> 2.0) + minitest (>= 4.7.5) + vcr (>= 2.9) 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.3.1) + oauth2 (~> 1.0) + omniauth (~> 1.2) pg (0.18.4) + pry (0.10.3) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-rails (0.3.4) + pry (>= 0.9.10) rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) @@ -98,6 +155,11 @@ GEM rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.3) loofah (~> 2.0) + rails_12factor (0.0.3) + rails_serve_static_assets + rails_stdout_logging + rails_serve_static_assets (0.0.5) + rails_stdout_logging (0.0.5) railties (4.2.6) actionpack (= 4.2.6) activesupport (= 4.2.6) @@ -106,6 +168,13 @@ 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) + ruby-progressbar (1.8.1) + safe_yaml (1.0.4) sass (3.4.22) sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) @@ -116,7 +185,13 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) - spring (1.7.1) + 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) + slop (3.6.0) sprockets (3.6.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -127,31 +202,59 @@ GEM thor (0.19.1) thread_safe (0.3.5) tilt (2.0.2) + turbolinks (2.5.3) + coffee-rails tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (3.0.0) execjs (>= 0.3.0, < 3) + vcr (3.0.1) web-console (2.3.0) activemodel (>= 4.0) binding_of_caller (>= 0.7.2) railties (>= 4.0) sprockets-rails (>= 2.0, < 4.0) + webmock (2.0.2) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff + yelp (2.1.2) + faraday (~> 0.8, >= 0.8.0) + faraday_middleware (~> 0.8, >= 0.8.0) + simple_oauth (~> 0.3.1) PLATFORMS ruby DEPENDENCIES - byebug + addressable + better_errors + byebug (= 8.2.5) coffee-rails (~> 4.1.0) + dotenv-rails + httparty (= 0.13.7) jbuilder (~> 2.0) jquery-rails + minitest-reporters + minitest-vcr + omniauth + omniauth-oauth2 (~> 1.3.1) pg (~> 0.15) + pry-rails (= 0.3.4) rails (= 4.2.6) + rails_12factor + rspotify (= 1.10.0) sass-rails (~> 5.0) sdoc (~> 0.4.0) - spring + simplecov (= 0.11.2) + turbolinks uglifier (>= 1.3.0) web-console (~> 2.0) + webmock (= 2.0.2) + yelp (~> 2.1, >= 2.1.2) + +RUBY VERSION + ruby 2.2.3p173 BUNDLED WITH - 1.12.3 + 1.12.4 diff --git a/app/assets/images/animated_favicon1.gif b/app/assets/images/animated_favicon1.gif new file mode 100755 index 0000000..e5a00a2 Binary files /dev/null and b/app/assets/images/animated_favicon1.gif differ diff --git a/app/assets/images/favicon.ico b/app/assets/images/favicon.ico new file mode 100755 index 0000000..9addc77 Binary files /dev/null and b/app/assets/images/favicon.ico differ 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/application.css b/app/assets/stylesheets/application.css index f9cd5b3..c401b7f 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,15 +1,86 @@ -/* - * 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. - * - *= require_tree . - *= require_self - */ +body { + background-image: url(https://cdn.elegantthemes.com/blog/wp-content/uploads/2013/09/bg-11-full.jpg); + background-image: url(http://static1.squarespace.com/static/54e5fa76e4b0453ef23d0e1c/t/55256769e4b007c5fd384a2e/1428514738661/website-background-image3_BRIGHTER.jpg?format=1200w); + height: 100%; + background-repeat: no-repeat; + background-attachment: fixed; +} + +.picprofile { + border-radius: 50%; + height: 50px; + width: 50px; +} + +.totheleft { + float: right; +} + +.table>tbody>tr>.food { + width: 42%; + padding: 4% 2%; + padding-right: 7%; +} + +.table>tbody>tr>.music { + width: 42%; + padding: 4% 7%; + padding-right: 2%; +} + +tr { + margin-bottom: 40px; + background-color: rgba(250, 250, 250, 0.7); +} + +.fava { + width: 16%; + text-align: center; +} + +.spotifypic { + height: 100px; + width: 100px; +} + +.spotifyheaderti { + margin-top: 0; + float: right; + text-align: right; + width: 60%; +} + +.spotifyheaderti h3 { + padding-top: 0; + margin-top: 0; +} + +.yelp_pic { + float: right; +} + +.yelpheader { + overflow: auto; +} + +.yelpheaderti{ + margin-top: 0; +} + +.ratingpic { + float: right; +} + +.yelprates { + overflow: auto; +} + +table a { + color: rgb(130, 16, 30); +} + +.iframe-frame { + margin-top: 60px; + height: 100px; + overflow: hidden; +} 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/application_controller.rb b/app/controllers/application_controller.rb index d83690e..5b6ec7b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,4 +2,20 @@ 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 + #protect_from_forgery with: :null_session + helper_method :current_user + + #before_action :require_login + + def current_user + @user ||= User.find_by(id: session[:user_id]) + end + + def require_login + if current_user.nil? + flash[:error] = "You must be logged in to view this section" + redirect_to root_path + end + end + end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 0000000..4719430 --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,24 @@ +class SessionsController < ApplicationController + skip_before_action :require_login, only: [:new, :create] + + 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 + flash[:notice] = "did not login in" + redirect_to root_path + 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 new file mode 100644 index 0000000..2d81ff9 --- /dev/null +++ b/app/controllers/suggestions_controller.rb @@ -0,0 +1,62 @@ +require "#{Rails.root}/lib/charles/TunesTakeoutWrapper.rb" + +class SuggestionsController < ApplicationController +before_action :require_login, only: [:favorites, :favorite, :unfavorites, :search_result] + def index + @top = Charles::TunesTakeoutWrapper.all_favorites + + if @top.nil? + flash.now[:notice] = "Something went wrong, please try again" + else + @zip = @top.suggestions.map do |sugg_hash| + [ + Music.create(sugg_hash["suggestion"]["music_type"], sugg_hash["suggestion"]["music_id"]), + Food.find_in_api(sugg_hash["suggestion"]["food_id"]), + sugg_hash["suggestion"]["id"] + ] + end + end + end + + def favorites + @my_favorites = Charles::TunesTakeoutWrapper.get_my_favorite(current_user.uid) + + if @my_favorites.suggestions.nil? + flash.now[:notice] = "Something went wrong, please try again" + else + @zip = @my_favorites.suggestions.map do |sugg_hash| + [ + Music.create(sugg_hash['suggestion']["music_type"], sugg_hash['suggestion']["music_id"]), + Food.find_in_api(sugg_hash['suggestion']["food_id"]), + sugg_hash['suggestion']["id"] + ] + end + end + end + + def favorite + @result = Charles::TunesTakeoutWrapper.add_favorite(params[:current_user_id], params[:suggestion_id]) + redirect_to my_favorites_path + end + + def unfavorite + @result = Charles::TunesTakeoutWrapper.delete_favorite(params[:current_user_id], params[:suggestion_id]) + redirect_to my_favorites_path + end + + def search_result + @all_suggestions = Charles::TunesTakeoutWrapper.find(params[:user_input]) + + if @all_suggestions.suggestions.nil? + flash.now[:notice] = "Something went wrong, please try again" + else + @zip = @all_suggestions.suggestions.map do |sugg_hash| + [ + Music.create(sugg_hash["music_type"], sugg_hash["music_id"]), + Food.find_in_api(sugg_hash["food_id"]), + sugg_hash["id"] + ] + end + end + end +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..f1e2c43 --- /dev/null +++ b/app/models/food.rb @@ -0,0 +1,21 @@ + +class Food + attr_reader :the_image_url, :rating, :name, :review_count, :rating_img_url_large, :categories, :location, :display_phone, :open_yelp_url + def initialize(data) + @the_image_url = data.business.image_url + @name = data.business.name + @rating = data.business.rating + @review_count = data.business.review_count + @rating_img_url_large = data.business.rating_img_url_large + @categories = data.business.categories + @location = data.business.location.display_address + @display_phone = data.business.display_phone + @open_yelp_url = data.business.url + end + + def self.find_in_api(id) + uri = Addressable::URI.parse(id) + data = Yelp.client.business(uri.normalize.to_s) + return self.new(data) + end +end diff --git a/app/models/music.rb b/app/models/music.rb new file mode 100644 index 0000000..977a313 --- /dev/null +++ b/app/models/music.rb @@ -0,0 +1,31 @@ +# require 'rspotify ' + +class Music + attr_reader :item_id, :type, :name, :open_spotify_url, :image, :uri + def initialize(data) + @item_id = data.id + @type = data.type + @name = data.name + @open_spotify_url = data.external_urls["spotify"] + if data.type == "track" + @image = data.album.images[1]["url"] + elsif data.type == "artist" + @image = data.albums[0].images[1]["url"] + else + @image = data.images[1]["url"] + end + @uri = data.uri + end + + def self.create(type, id) + if type == "artist" + music_result = RSpotify::Artist.find(id) + elsif type == "album" + music_result = RSpotify::Album.find(id) + else + music_result = RSpotify::Track.find(id) + end + return self.new(music_result) + end + +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000..5fa54ea --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,31 @@ +class User < ActiveRecord::Base + validates :uid, :provider, presence: true + #:name + + def self.find_or_create_from_omniauth(auth_hash) + # Find or create a user + + user = self.find_by(uid: auth_hash["info"]["id"], provider: auth_hash["provider"]) + if !user.nil? + return user + else + user = User.new + if auth_hash["info"]["images"] == [] + user.uid = auth_hash["info"]["id"] + user.images = "http://i1.wp.com/www.techrepublic.com/bundles/techrepubliccore/images/icons/standard/icon-user-default.png" + else + user.uid = auth_hash["uid"] + user.name = auth_hash["info"]["display_name"] + user.images = auth_hash["info"]["images"][0]["url"] + end + user.open_spotify_url = auth_hash["info"]["external_urls"]["spotify"] + user.provider = auth_hash["provider"] + + 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 509d1a2..8567205 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,10 +5,73 @@ <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag 'application' %> <%= csrf_meta_tags %> + + + + + + + + +<%= favicon_link_tag 'favicon.ico' %> + -<%= yield %> + + + + <% if flash[:notice] -%> + + <% end %> + +
+ <%= yield %> +
diff --git a/app/views/sessions/create.html.erb b/app/views/sessions/create.html.erb new file mode 100644 index 0000000..c251174 --- /dev/null +++ b/app/views/sessions/create.html.erb @@ -0,0 +1,2 @@ +

Sessions#create

+

Find me in app/views/sessions/create.html.erb

diff --git a/app/views/sessions/destroy.html.erb b/app/views/sessions/destroy.html.erb new file mode 100644 index 0000000..d75237d --- /dev/null +++ b/app/views/sessions/destroy.html.erb @@ -0,0 +1,2 @@ +

Sessions#destroy

+

Find me in app/views/sessions/destroy.html.erb

diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb new file mode 100644 index 0000000..b39a3bc --- /dev/null +++ b/app/views/sessions/new.html.erb @@ -0,0 +1,2 @@ +

Sessions#new

+

Find me in app/views/sessions/new.html.erb

diff --git a/app/views/suggestions/_suggestion.html.erb b/app/views/suggestions/_suggestion.html.erb new file mode 100644 index 0000000..935161c --- /dev/null +++ b/app/views/suggestions/_suggestion.html.erb @@ -0,0 +1,78 @@ +<% if @zip %> + <% @zip.map do |pair|%> + + + + + <%if current_user%> + + <%end%> + + + + + +
+ <%= link_to pair[0].open_spotify_url, target: :_blank do %> + <%= image_tag pair[0].image, size: '100X100', alt: "Profile Photo", class: "spotifypic" %> +
+

<%= pair[0].name %>

+ Type : <%= pair[0].type.capitalize %> +
+ <% end %> +
+ +
+ <%= button_to "Open in Spotify", pair[0].open_spotify_url, method: :get, class: "btn btn-success" %> +
+ <%= form_tag add_favorite_path, method: :post do %> + <%=hidden_field_tag :current_user_id, current_user.uid%> + <%=hidden_field_tag :suggestion_id, pair[2]%> + <%=submit_tag 'Favorite!', class: "btn btn-primary"%> + <%end%> +
+ + <%= form_tag unfavorite_path, method: :delete do %> + <%=hidden_field_tag :current_user_id, current_user.uid%> + <%=hidden_field_tag :suggestion_id, pair[2]%> + <%=submit_tag 'Unfavorite!', class: "btn btn-primary"%> + <%end%> +
+
+ <%= link_to pair[1].open_yelp_url, target: :_blank do %> + <%= image_tag pair[1].the_image_url, alt: pair[1].the_image_url, class: "yelp_pic" %> +

<%= pair[1].name %>

+ <% end %> + <% unless pair[1].display_phone.nil? %> + <%= link_to "tel:#{pair[1].display_phone}" do%> +   <%= pair[1].display_phone[3..-1] %> + <% end %> + + <% end %> +
+
+ + <% pair[1].location.map do |loc| %> + <%= loc %> +
+ <%end %> + +
+
+
+ Rating : <%= pair[1].rating%> + <%= image_tag pair[1].rating_img_url_large, alt: pair[1].rating_img_url_large, class: "ratingpic" %> +
+ Total Reviews: <%= pair[1].review_count%> +
+ +
+ Categories : <% pair[1].categories.map do |cat| %> + <%= cat[0] + ". " %> + <%end %> +

+ <%= button_to "Open in Yelp", pair[1].open_yelp_url, method: :get, class: "btn btn-danger" %> +
+ + <%end%> +<%end%> diff --git a/app/views/suggestions/favorite.html.erb b/app/views/suggestions/favorite.html.erb new file mode 100644 index 0000000..0fb3d0b --- /dev/null +++ b/app/views/suggestions/favorite.html.erb @@ -0,0 +1 @@ +<%= @result %> diff --git a/app/views/suggestions/favorites.html.erb b/app/views/suggestions/favorites.html.erb new file mode 100644 index 0000000..ad9371a --- /dev/null +++ b/app/views/suggestions/favorites.html.erb @@ -0,0 +1,3 @@ +

Favorites for <%=current_user.uid%>!!

+ +<%= render partial: "suggestion"%> diff --git a/app/views/suggestions/index.html.erb b/app/views/suggestions/index.html.erb new file mode 100644 index 0000000..2acb6ac --- /dev/null +++ b/app/views/suggestions/index.html.erb @@ -0,0 +1,2 @@ + +<%= render partial: "suggestion"%> diff --git a/app/views/suggestions/search_result.html.erb b/app/views/suggestions/search_result.html.erb new file mode 100644 index 0000000..2acb6ac --- /dev/null +++ b/app/views/suggestions/search_result.html.erb @@ -0,0 +1,2 @@ + +<%= render partial: "suggestion"%> diff --git a/app/views/suggestions/unfavorite.html.erb b/app/views/suggestions/unfavorite.html.erb new file mode 100644 index 0000000..ee38a18 --- /dev/null +++ b/app/views/suggestions/unfavorite.html.erb @@ -0,0 +1,2 @@ +

Suggestions#unfavorite

+

Find me in app/views/suggestions/unfavorite.html.erb

diff --git a/config/database.yml b/config/database.yml index f2392b7..ab87002 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,83 +1,16 @@ -# PostgreSQL. Versions 8.2 and up are supported. -# -# Install the pg driver: -# gem install pg -# On OS X with Homebrew: -# gem install pg -- --with-pg-config=/usr/local/bin/pg_config -# On OS X with MacPorts: -# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config -# On Windows: -# gem install pg -# Choose the win32 build. -# Install PostgreSQL and put its /bin directory on your path. -# -# Configure Using Gemfile -# gem 'pg' -# default: &default adapter: postgresql encoding: unicode - # For details on connection pooling, see rails configuration guide - # http://guides.rubyonrails.org/configuring.html#database-pooling pool: 5 development: <<: *default database: tunes-takeout_development - # The specified database role being used to connect to postgres. - # To create additional roles in postgres see `$ createuser --help`. - # When left blank, postgres will use the default role. This is - # the same name as the operating system user that initialized the database. - #username: tunes-takeout - - # The password associated with the postgres role (username). - #password: - - # Connect on a TCP socket. Omitted by default since the client uses a - # domain socket that doesn't need configuration. Windows does not have - # domain sockets, so uncomment these lines. - #host: localhost - - # The TCP port the server listens on. Defaults to 5432. - # If your server runs on a different port number, change accordingly. - #port: 5432 - - # Schema search path. The server defaults to $user,public - #schema_search_path: myapp,sharedapp,public - - # Minimum log levels, in increasing order: - # debug5, debug4, debug3, debug2, debug1, - # log, notice, warning, error, fatal, and panic - # Defaults to warning. - #min_messages: notice - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. test: <<: *default database: tunes-takeout_test -# As with config/secrets.yml, you never want to store sensitive information, -# like your database password, in your source code. If your source code is -# ever seen by anyone, they now have access to your database. -# -# Instead, provide the password as a unix environment variable when you boot -# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database -# for a full rundown on how to provide these environment variables in a -# production deployment. -# -# On Heroku and other platform providers, you may have a full connection URL -# available as an environment variable. For example: -# -# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" -# -# You can use this database configuration with: -# -# production: -# url: <%= ENV['DATABASE_URL'] %> -# production: <<: *default database: tunes-takeout_production diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb new file mode 100644 index 0000000..cc0c5f5 --- /dev/null +++ b/config/initializers/omniauth.rb @@ -0,0 +1,3 @@ +Rails.application.config.middleware.use OmniAuth::Builder do + provider :spotify, ENV["SPOTIFY_CLIENT_ID"], ENV["SPOTIFY_CLIENT_SECRET"] +end diff --git a/config/initializers/yelp.rb b/config/initializers/yelp.rb new file mode 100644 index 0000000..540ed17 --- /dev/null +++ b/config/initializers/yelp.rb @@ -0,0 +1,6 @@ +Yelp.client.configure do |config| + 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 diff --git a/config/routes.rb b/config/routes.rb index 3f66539..766be19 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,23 @@ Rails.application.routes.draw do + root 'suggestions#index' + + get '/' => 'suggestions#index' + + post '/search_result' => 'suggestions#search_result' + + post '/suggestions/favorite' => 'suggestions#favorite', as: :add_favorite + get '/suggestions/myfavs' => 'suggestions#favorites', as: :my_favorites + + + delete 'suggestions/unfavorite' => 'suggestions#unfavorite', as: :unfavorite + + resources :sessions, :only => [:create] + + delete "/logout" => "sessions#destroy" + # get "/login" => "sessions#new" + get "/auth/:provider/callback" => "sessions#create" + + # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". diff --git a/db/migrate/20160518214822_create_users.rb b/db/migrate/20160518214822_create_users.rb new file mode 100644 index 0000000..33b1fe9 --- /dev/null +++ b/db/migrate/20160518214822_create_users.rb @@ -0,0 +1,12 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + + t.string :uid, null:false # for the unique user identifier from the provider + t.string :provider, null:false # for the provider name + t.string :name + t.string :email + t.timestamps null: false + end + end +end diff --git a/db/migrate/20160518223830_addimagesto_user.rb b/db/migrate/20160518223830_addimagesto_user.rb new file mode 100644 index 0000000..43b70d6 --- /dev/null +++ b/db/migrate/20160518223830_addimagesto_user.rb @@ -0,0 +1,5 @@ +class AddimagestoUser < ActiveRecord::Migration + def change + add_column :users, :images, :string # for the unique user identifier from the provider + end +end diff --git a/db/migrate/20160521215155_add_url_to_users.rb b/db/migrate/20160521215155_add_url_to_users.rb new file mode 100644 index 0000000..c73500c --- /dev/null +++ b/db/migrate/20160521215155_add_url_to_users.rb @@ -0,0 +1,6 @@ +class AddUrlToUsers < ActiveRecord::Migration + def change + add_column :users, :open_spotify_url, :string # for the unique user identifier from the provider + + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..188878e --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,30 @@ +# 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: 20160521215155) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "users", force: :cascade do |t| + t.string "uid", null: false + t.string "provider", null: false + t.string "name" + t.string "email" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "images" + t.string "open_spotify_url" + end + +end diff --git a/lib/charles/TunesTakeoutWrapper.rb b/lib/charles/TunesTakeoutWrapper.rb new file mode 100644 index 0000000..774e437 --- /dev/null +++ b/lib/charles/TunesTakeoutWrapper.rb @@ -0,0 +1,44 @@ +require 'httparty' +module Charles + class TunesTakeoutWrapper + BASE_URL = "https://tunes-takeout-api.herokuapp.com" + attr_reader :suggestions + def initialize(data) + @suggestions = data + #@food_id = data["suggestions"]["food_id"] + # @music_id = data["suggestions"]["music_id"] + # @music_type = data["suggestions"]["music_type"] + end + + def self.find(user_input) + data = HTTParty.get(BASE_URL + "/v1/suggestions/search?query=#{user_input}/").parsed_response + return self.new(data["suggestions"]) + end + + def self.all_favorites + data = HTTParty.get(BASE_URL + "/v1/suggestions/top").parsed_response + total = data["suggestions"].map do |one_charles_id| + HTTParty.get(BASE_URL + "/v1/suggestions/#{one_charles_id}").parsed_response + end + return self.new(total) + end + + def self.add_favorite(current_user_id,suggestion_id) + HTTParty.post(BASE_URL + "/v1/users/#{current_user_id}/favorites", body: { "suggestion": suggestion_id}.to_json, headers: { 'Content-Type' => 'application/json' }) + + end + + def self.get_my_favorite(current_user_id) + data = HTTParty.get(BASE_URL + "/v1/users/#{current_user_id}/favorites").parsed_response + total = data["suggestions"].map do |one_fav_id| + HTTParty.get(BASE_URL + "/v1/suggestions/#{one_fav_id}").parsed_response + end + return self.new(total) + + end + + def self.delete_favorite(current_user_id,suggestion_id) + HTTParty.delete(BASE_URL + "/v1/users/#{current_user_id}/favorites", body: { "suggestion": suggestion_id}.to_json, headers: { 'Content-Type' => 'application/json' }) + end + end +end diff --git a/test/TunesTakeoutWrapper_test.rb b/test/TunesTakeoutWrapper_test.rb new file mode 100644 index 0000000..5a93c98 --- /dev/null +++ b/test/TunesTakeoutWrapper_test.rb @@ -0,0 +1,56 @@ +require 'test_helper' + + class TunesTakeoutWrapperTest < ActiveSupport::TestCase + + describe "Charles::TunesTakeoutWrapper" do + it "uses v1 of the API" do + assert_equal "https://tunes-takeout-api.herokuapp.com", BASE_URL + end + + describe "API" , :vcr do + before do + @taco = TunesTakeoutWrapper.find("taco") + @top_favorites = TunesTakeoutWrapper.all_favorites + @add_favorite = TunesTakeoutWrapper.add_favorite("americandreamers", suggestion_id) + @search_result = TunesTakeoutWrapper.search_result("Vz0KO4-RRwADbn9f") + @my_favs = TunesTakeoutWrapper.get_my_favorite("americandreamers") + end + + + # it "returns twenty pairing suggestions", :vcr do + # assert_equal 20, @taco.class + # end + # + # it "will return a list of top_favorites favorites", :vcr do + # assert_equal @top_favorites.class, Array + # refute_nil @top_favorites + # end + + # it "will return favorites for a given user id", :vcr do + # assert_equal @favorite_id_array.class, Array + # assert_equal @favorite_id_array.length, 12 + # refute_nil @favorite_id_array + # end + # + # it "can search a pairing by suggestion id", :vcr do + # assert_equal @single_pairing["id"], "Vz0KO4-RRwADbn9f" + # refute_nil @single_pairing + # end + + # it "can favorite a suggestion" , :vcr do + # @original_count = @favorite_id_array.count + # TunesTakeoutWrapper.make_favorite('1226771573', "Vz92VPLW7wADpNDB") + # @new_count = TunesTakeoutWrapper.favorites_by_user("1226771573").count + # assert_equal (@original_count), @new_count + # end + # + # it "can unfavorite a suggestion", :vcr do + # TunesTakeoutWrapper.make_favorite('1226771573', "Vz0KNY-RRwADbn3d") + # @original_count = @favorite_id_array.count + # TunesTakeoutWrapper.unfavorite('1226771573', "Vz0KNY-RRwADbn3d") + # @new_count = TunesTakeoutWrapper.favorites_by_user("1226771573").count + # assert_equal (@original_count), @new_count + # end + end + end + end diff --git a/test/cassettes/API/knows_its_name.yml b/test/cassettes/API/knows_its_name.yml new file mode 100644 index 0000000..34183b5 --- /dev/null +++ b/test/cassettes/API/knows_its_name.yml @@ -0,0 +1,130 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4 + 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 07:06:25 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 |- + H4sIAAAAAAAAAHyQSwvCMBCE7/6K0LNYKj315smDICI+QBEJNdXo5kGyUWvp + f7dNquhBj/vtzOywVY+QiN2RGUlh7wzYiGSkamjDrVbIi7Il0QlR2yyOlWZy + 0C0GuRIxNcgtxslZpqPF8DyeCFiuNmvhHtNZGjVBdb+9USgAdWPmM/9kWNGO + 0gH0A0KFFFqWvp1HJg3zti3ZefLyvUtRzb86XZOulv3Vy+fwg0/5KxH0+H1c + UsG8bc7zS0kWNFdBqpV2QA1H/7DEMyx1EIc6QegM96xrnIVd9uuD9RMAAP// + AwBmqBvMpAEAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:06:25 GMT +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4/albums?limit=20&offset=0 + 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 07:06:25 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 |- + H4sIAAAAAAAAAIxU207bQBB95ysiP/AU4Ut8SyRUQQJJShIiQkJLVUUb75gs + 9U32Oi1F/HvXx4YqUmh5OdqdmT3n7Oxon49aLW2bU6i1emohZVb0dJ1l4qTI + UinCp5MgjfWdqbNcikIWuvmY2Ge31uPwKo6Wq/u7uPw9m9s6izZlXHxKw7Ag + eWocRyIW8tQyjpFYy6eMTguRPETURqStaDMRMSnSpM2yjFherNWSMq1dWRKS + 4qLy9K31rPYq8pcIVrFFbZXbMcW1iWgds/wHyeakdnajtRUugbcVnl8Ar4HI + ng8r7J8BJ0Bk+8j2vwLvKxxcAZEdgOeiD8R6sarwcgzE2WGN0B3NgGAYwc94 + AcTZMWomYJjUa9RMoT5FZPqlwhkczuBnBq0Z/Mzhf476OTjnIyDq52BY4KYL + eLiA+gKVfVTe3gHheQmeJWqG5+jeAK6gOMWtxwOt9b3pP/2SlCcsWpd5hN7X + b6YyzRTtTVeaUbI3XnhL3Znwkk9W19utH48/r25iyzaXlxqYXhqhD00qRvE9 + uoZIcND8pyhmD7Q3hZUFEg9bWQVd22i/RtXF93wpVwFPlCUdJPrGtAOfsZDZ + ru+6Hc8nTjzkXXJ8ChyLPHICCv2u9sb4U3C5bWSaHhwy0TE+bsLwHdO2A6Pj + uaa3cSzHUOqG5zkmkcM6XZMHrmsy64AJJfMPE679YQ+mv7GVstMJlLJL9sbm + vud3beLctDizlTXmccM52IjawtvYJSyuP4ORMkJ5a0I7il4f7/BPUeYCwWZm + ekj23h+9RkzDf1adtNBuLVEjX22TMooQqH++KlQXZDntRFoWe0UylQztMY9e + /gAAAP//AwDCP13JegUAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:06:25 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/API/knows_its_type.yml b/test/cassettes/API/knows_its_type.yml new file mode 100644 index 0000000..2be94e2 --- /dev/null +++ b/test/cassettes/API/knows_its_type.yml @@ -0,0 +1,130 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4 + 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 07:06:25 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 |- + H4sIAAAAAAAAAHyQSwvCMBCE7/6K0LNYKj315smDICI+QBEJNdXo5kGyUWvp + f7dNquhBj/vtzOywVY+QiN2RGUlh7wzYiGSkamjDrVbIi7Il0QlR2yyOlWZy + 0C0GuRIxNcgtxslZpqPF8DyeCFiuNmvhHtNZGjVBdb+9USgAdWPmM/9kWNGO + 0gH0A0KFFFqWvp1HJg3zti3ZefLyvUtRzb86XZOulv3Vy+fwg0/5KxH0+H1c + UsG8bc7zS0kWNFdBqpV2QA1H/7DEMyx1EIc6QegM96xrnIVd9uuD9RMAAP// + AwBmqBvMpAEAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:06:25 GMT +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4/albums?limit=20&offset=0 + 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 07:06:26 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 |- + H4sIAAAAAAAAAIxU207bQBB95ysiP/AU4Ut8SyRUQQJJShIiQkJLVUUb75gs + 9U32Oi1F/HvXx4YqUmh5OdqdmT3n7Oxon49aLW2bU6i1emohZVb0dJ1l4qTI + UinCp5MgjfWdqbNcikIWuvmY2Ge31uPwKo6Wq/u7uPw9m9s6izZlXHxKw7Ag + eWocRyIW8tQyjpFYy6eMTguRPETURqStaDMRMSnSpM2yjFherNWSMq1dWRKS + 4qLy9K31rPYq8pcIVrFFbZXbMcW1iWgds/wHyeakdnajtRUugbcVnl8Ar4HI + ng8r7J8BJ0Bk+8j2vwLvKxxcAZEdgOeiD8R6sarwcgzE2WGN0B3NgGAYwc94 + AcTZMWomYJjUa9RMoT5FZPqlwhkczuBnBq0Z/Mzhf476OTjnIyDq52BY4KYL + eLiA+gKVfVTe3gHheQmeJWqG5+jeAK6gOMWtxwOt9b3pP/2SlCcsWpd5hN7X + b6YyzRTtTVeaUbI3XnhL3Znwkk9W19utH48/r25iyzaXlxqYXhqhD00qRvE9 + uoZIcND8pyhmD7Q3hZUFEg9bWQVd22i/RtXF93wpVwFPlCUdJPrGtAOfsZDZ + ru+6Hc8nTjzkXXJ8ChyLPHICCv2u9sb4U3C5bWSaHhwy0TE+bsLwHdO2A6Pj + uaa3cSzHUOqG5zkmkcM6XZMHrmsy64AJJfMPE679YQ+mv7GVstMJlLJL9sbm + vud3beLctDizlTXmccM52IjawtvYJSyuP4ORMkJ5a0I7il4f7/BPUeYCwWZm + ekj23h+9RkzDf1adtNBuLVEjX22TMooQqH++KlQXZDntRFoWe0UylQztMY9e + /gAAAP//AwDCP13JegUAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:06:25 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/API/knows_that_it_has_an_image_url.yml b/test/cassettes/API/knows_that_it_has_an_image_url.yml new file mode 100644 index 0000000..34183b5 --- /dev/null +++ b/test/cassettes/API/knows_that_it_has_an_image_url.yml @@ -0,0 +1,130 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4 + 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 07:06:25 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 |- + H4sIAAAAAAAAAHyQSwvCMBCE7/6K0LNYKj315smDICI+QBEJNdXo5kGyUWvp + f7dNquhBj/vtzOywVY+QiN2RGUlh7wzYiGSkamjDrVbIi7Il0QlR2yyOlWZy + 0C0GuRIxNcgtxslZpqPF8DyeCFiuNmvhHtNZGjVBdb+9USgAdWPmM/9kWNGO + 0gH0A0KFFFqWvp1HJg3zti3ZefLyvUtRzb86XZOulv3Vy+fwg0/5KxH0+H1c + UsG8bc7zS0kWNFdBqpV2QA1H/7DEMyx1EIc6QegM96xrnIVd9uuD9RMAAP// + AwBmqBvMpAEAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:06:25 GMT +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4/albums?limit=20&offset=0 + 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 07:06:25 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 |- + H4sIAAAAAAAAAIxU207bQBB95ysiP/AU4Ut8SyRUQQJJShIiQkJLVUUb75gs + 9U32Oi1F/HvXx4YqUmh5OdqdmT3n7Oxon49aLW2bU6i1emohZVb0dJ1l4qTI + UinCp5MgjfWdqbNcikIWuvmY2Ge31uPwKo6Wq/u7uPw9m9s6izZlXHxKw7Ag + eWocRyIW8tQyjpFYy6eMTguRPETURqStaDMRMSnSpM2yjFherNWSMq1dWRKS + 4qLy9K31rPYq8pcIVrFFbZXbMcW1iWgds/wHyeakdnajtRUugbcVnl8Ar4HI + ng8r7J8BJ0Bk+8j2vwLvKxxcAZEdgOeiD8R6sarwcgzE2WGN0B3NgGAYwc94 + AcTZMWomYJjUa9RMoT5FZPqlwhkczuBnBq0Z/Mzhf476OTjnIyDq52BY4KYL + eLiA+gKVfVTe3gHheQmeJWqG5+jeAK6gOMWtxwOt9b3pP/2SlCcsWpd5hN7X + b6YyzRTtTVeaUbI3XnhL3Znwkk9W19utH48/r25iyzaXlxqYXhqhD00qRvE9 + uoZIcND8pyhmD7Q3hZUFEg9bWQVd22i/RtXF93wpVwFPlCUdJPrGtAOfsZDZ + ru+6Hc8nTjzkXXJ8ChyLPHICCv2u9sb4U3C5bWSaHhwy0TE+bsLwHdO2A6Pj + uaa3cSzHUOqG5zkmkcM6XZMHrmsy64AJJfMPE679YQ+mv7GVstMJlLJL9sbm + vud3beLctDizlTXmccM52IjawtvYJSyuP4ORMkJ5a0I7il4f7/BPUeYCwWZm + ekj23h+9RkzDf1adtNBuLVEjX22TMooQqH++KlQXZDntRFoWe0UylQztMY9e + /gAAAP//AwDCP13JegUAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:06:25 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/API/knows_that_it_has_an_open_in_spotify_url.yml b/test/cassettes/API/knows_that_it_has_an_open_in_spotify_url.yml new file mode 100644 index 0000000..01114fa --- /dev/null +++ b/test/cassettes/API/knows_that_it_has_an_open_in_spotify_url.yml @@ -0,0 +1,130 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4 + 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 07:06:26 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 |- + H4sIAAAAAAAAAHyQSwvCMBCE7/6K0LNYKj315smDICI+QBEJNdXo5kGyUWvp + f7dNquhBj/vtzOywVY+QiN2RGUlh7wzYiGSkamjDrVbIi7Il0QlR2yyOlWZy + 0C0GuRIxNcgtxslZpqPF8DyeCFiuNmvhHtNZGjVBdb+9USgAdWPmM/9kWNGO + 0gH0A0KFFFqWvp1HJg3zti3ZefLyvUtRzb86XZOulv3Vy+fwg0/5KxH0+H1c + UsG8bc7zS0kWNFdBqpV2QA1H/7DEMyx1EIc6QegM96xrnIVd9uuD9RMAAP// + AwBmqBvMpAEAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:06:25 GMT +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4/albums?limit=20&offset=0 + 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 07:06:26 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 |- + H4sIAAAAAAAAAIxU207bQBB95ysiP/AU4Ut8SyRUQQJJShIiQkJLVUUb75gs + 9U32Oi1F/HvXx4YqUmh5OdqdmT3n7Oxon49aLW2bU6i1emohZVb0dJ1l4qTI + UinCp5MgjfWdqbNcikIWuvmY2Ge31uPwKo6Wq/u7uPw9m9s6izZlXHxKw7Ag + eWocRyIW8tQyjpFYy6eMTguRPETURqStaDMRMSnSpM2yjFherNWSMq1dWRKS + 4qLy9K31rPYq8pcIVrFFbZXbMcW1iWgds/wHyeakdnajtRUugbcVnl8Ar4HI + ng8r7J8BJ0Bk+8j2vwLvKxxcAZEdgOeiD8R6sarwcgzE2WGN0B3NgGAYwc94 + AcTZMWomYJjUa9RMoT5FZPqlwhkczuBnBq0Z/Mzhf476OTjnIyDq52BY4KYL + eLiA+gKVfVTe3gHheQmeJWqG5+jeAK6gOMWtxwOt9b3pP/2SlCcsWpd5hN7X + b6YyzRTtTVeaUbI3XnhL3Znwkk9W19utH48/r25iyzaXlxqYXhqhD00qRvE9 + uoZIcND8pyhmD7Q3hZUFEg9bWQVd22i/RtXF93wpVwFPlCUdJPrGtAOfsZDZ + ru+6Hc8nTjzkXXJ8ChyLPHICCv2u9sb4U3C5bWSaHhwy0TE+bsLwHdO2A6Pj + uaa3cSzHUOqG5zkmkcM6XZMHrmsy64AJJfMPE679YQ+mv7GVstMJlLJL9sbm + vud3beLctDizlTXmccM52IjawtvYJSyuP4ORMkJ5a0I7il4f7/BPUeYCwWZm + ekj23h+9RkzDf1adtNBuLVEjX22TMooQqH++KlQXZDntRFoWe0UylQztMY9e + /gAAAP//AwDCP13JegUAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:06:26 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/Food/knows_its_categories.yml b/test/cassettes/Food/knows_its_categories.yml new file mode 100644 index 0000000..73a9523 --- /dev/null +++ b/test/cassettes/Food/knows_its_categories.yml @@ -0,0 +1,89 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/seattle-yoga-lounge-seattle + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="3d3fe002ac77661d7089da3adad790c2", + oauth_signature="2TNfjcgMbdm0540ur6eB14rPTgM%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463930718", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + 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 15:25:19 GMT + Content-Type: + - application/json; charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d0e7a3ca7d2b9a0463a8a5aac178d88af1463930718; expires=Mon, 22-May-17 + 15:25:18 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=0463b52792b8e4af7deae6b7e25e8008; Domain=.yelp.com; Path=/; HttpOnly + - yuv=HaCGYwONffNLt_mfui_1rG6OJ9x8hsNG0Gp18V6ZOGITTE1o6Hvt8EeKoOPGjYTaS4lAuU_6VIz_xrN6qHIgWLkU_wipgyH8; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 15:25:18 + GMT + X-Node: + - 10-64-133-164-uswest1bprod + - api_com + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Sun, 22 May 2016 15:25:18 GMT + Pragma: + - no-cache + Vary: + - Accept-Encoding,User-Agent + X-Mode: + - ro + X-Proxied: + - 10-64-0-189-uswest1aprod + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7147b0af41050e-SEA + body: + encoding: ASCII-8BIT + string: '{"is_claimed": true, "rating": 3.5, "mobile_url": "http://m.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "rating_img_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png", + "review_count": 92, "name": "Seattle Yoga Lounge", "rating_img_url_small": + "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/2e909d5d3536/ico/stars/v1/stars_small_3_half.png", + "url": "http://www.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "categories": [["Yoga", "yoga"]], "reviews": [{"rating": 4, "excerpt": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "time_created": 1459828326, "rating_image_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png", + "rating_image_small_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png", + "user": {"image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "id": "E3R2xduRKT1aaA6OZq9hSg", "name": "Jen T."}, "rating_image_large_url": + "https://s3-media2.fl.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png", + "id": "AUIhjm4OQAoshRwsJI_fRg"}], "phone": "2065234569", "snippet_text": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "image_url": "https://s3-media4.fl.yelpcdn.com/bphoto/dSbX4D2yBBYq4L7Y7g0yqQ/ms.jpg", + "snippet_image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "display_phone": "+1-206-523-4569", "rating_img_url_large": "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/bd9b7a815d1b/ico/stars/v1/stars_large_3_half.png", + "id": "seattle-yoga-lounge-seattle", "is_closed": false, "location": {"city": + "Seattle", "display_address": ["6900 E Greenlake Way", "Ste L", "Greenlake", + "Seattle, WA 98115"], "geo_accuracy": 9.5, "neighborhoods": ["Greenlake"], + "postal_code": "98115", "country_code": "US", "address": ["6900 E Greenlake + Way", "Ste L"], "coordinate": {"latitude": 47.678218, "longitude": -122.326477}, + "state_code": "WA"}}' + http_version: + recorded_at: Sun, 22 May 2016 15:25:19 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/Food/knows_its_display_phone.yml b/test/cassettes/Food/knows_its_display_phone.yml new file mode 100644 index 0000000..47a81b0 --- /dev/null +++ b/test/cassettes/Food/knows_its_display_phone.yml @@ -0,0 +1,89 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/seattle-yoga-lounge-seattle + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="daa89d23836dbe64eff080e57f49927a", + oauth_signature="9KyYlfzV4N1yvVobLwnj5Ll%2FgsQ%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463930719", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + 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 15:25:19 GMT + Content-Type: + - application/json; charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d8cbb3ec6b2bebd191d7ef7ffd282a2001463930719; expires=Mon, 22-May-17 + 15:25:19 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=4740acef0b08c13c248e6e458a794a17; Domain=.yelp.com; Path=/; HttpOnly + - yuv=-OhxdAWjOCtpXcJ1VmfX8njNIMJPe9BxHnpyvM_9kGJ2Mcvcr_h5q4m63gWmGlcOPfhmAE1uaxzF-x8oJqAN-GHds2iFc7mZ; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 15:25:19 + GMT + X-Node: + - 10-64-109-175-uswest1aprod + - api_com + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Sun, 22 May 2016 15:25:19 GMT + Pragma: + - no-cache + Vary: + - Accept-Encoding,User-Agent + X-Mode: + - ro + X-Proxied: + - 10-64-0-189-uswest1aprod + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7147b2e2142a61-SEA + body: + encoding: ASCII-8BIT + string: '{"is_claimed": true, "rating": 3.5, "mobile_url": "http://m.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "rating_img_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png", + "review_count": 92, "name": "Seattle Yoga Lounge", "rating_img_url_small": + "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/2e909d5d3536/ico/stars/v1/stars_small_3_half.png", + "url": "http://www.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "categories": [["Yoga", "yoga"]], "reviews": [{"rating": 4, "excerpt": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "time_created": 1459828326, "rating_image_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png", + "rating_image_small_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png", + "user": {"image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "id": "E3R2xduRKT1aaA6OZq9hSg", "name": "Jen T."}, "rating_image_large_url": + "https://s3-media2.fl.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png", + "id": "AUIhjm4OQAoshRwsJI_fRg"}], "phone": "2065234569", "snippet_text": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "image_url": "https://s3-media4.fl.yelpcdn.com/bphoto/dSbX4D2yBBYq4L7Y7g0yqQ/ms.jpg", + "snippet_image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "display_phone": "+1-206-523-4569", "rating_img_url_large": "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/bd9b7a815d1b/ico/stars/v1/stars_large_3_half.png", + "id": "seattle-yoga-lounge-seattle", "is_closed": false, "location": {"city": + "Seattle", "display_address": ["6900 E Greenlake Way", "Ste L", "Greenlake", + "Seattle, WA 98115"], "geo_accuracy": 9.5, "neighborhoods": ["Greenlake"], + "postal_code": "98115", "country_code": "US", "address": ["6900 E Greenlake + Way", "Ste L"], "coordinate": {"latitude": 47.678218, "longitude": -122.326477}, + "state_code": "WA"}}' + http_version: + recorded_at: Sun, 22 May 2016 15:25:19 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/Food/knows_its_location.yml b/test/cassettes/Food/knows_its_location.yml new file mode 100644 index 0000000..27ca3d9 --- /dev/null +++ b/test/cassettes/Food/knows_its_location.yml @@ -0,0 +1,89 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/seattle-yoga-lounge-seattle + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="f3e2fcc3a7a3466d5086d07df5078cd8", + oauth_signature="0M5fvVe5m3lydP%2FTmDBihRKXEWU%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463930719", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + 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 15:25:19 GMT + Content-Type: + - application/json; charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=dc4693c65b75833235df80ee9db7dccca1463930719; expires=Mon, 22-May-17 + 15:25:19 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=3328b358f34ae01e7631c02bdfc426db; Domain=.yelp.com; Path=/; HttpOnly + - yuv=eTq2Z8vcBvhBhhMj2uZrZzx5uwGXmIPGOdLL0ooSbzQNjJ1Y276j4md1o7_J8phF6izGsbbMvYmm4NLl23mnTR83dv0-8DOk; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 15:25:19 + GMT + X-Node: + - 10-64-109-177-uswest1aprod + - api_com + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Sun, 22 May 2016 15:25:19 GMT + Pragma: + - no-cache + Vary: + - Accept-Encoding,User-Agent + X-Mode: + - ro + X-Proxied: + - 10-64-0-189-uswest1aprod + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7147b50e1c2a79-SEA + body: + encoding: ASCII-8BIT + string: '{"is_claimed": true, "rating": 3.5, "mobile_url": "http://m.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "rating_img_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png", + "review_count": 92, "name": "Seattle Yoga Lounge", "rating_img_url_small": + "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/2e909d5d3536/ico/stars/v1/stars_small_3_half.png", + "url": "http://www.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "categories": [["Yoga", "yoga"]], "reviews": [{"rating": 4, "excerpt": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "time_created": 1459828326, "rating_image_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png", + "rating_image_small_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png", + "user": {"image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "id": "E3R2xduRKT1aaA6OZq9hSg", "name": "Jen T."}, "rating_image_large_url": + "https://s3-media2.fl.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png", + "id": "AUIhjm4OQAoshRwsJI_fRg"}], "phone": "2065234569", "snippet_text": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "image_url": "https://s3-media4.fl.yelpcdn.com/bphoto/dSbX4D2yBBYq4L7Y7g0yqQ/ms.jpg", + "snippet_image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "display_phone": "+1-206-523-4569", "rating_img_url_large": "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/bd9b7a815d1b/ico/stars/v1/stars_large_3_half.png", + "id": "seattle-yoga-lounge-seattle", "is_closed": false, "location": {"city": + "Seattle", "display_address": ["6900 E Greenlake Way", "Ste L", "Greenlake", + "Seattle, WA 98115"], "geo_accuracy": 9.5, "neighborhoods": ["Greenlake"], + "postal_code": "98115", "country_code": "US", "address": ["6900 E Greenlake + Way", "Ste L"], "coordinate": {"latitude": 47.678218, "longitude": -122.326477}, + "state_code": "WA"}}' + http_version: + recorded_at: Sun, 22 May 2016 15:25:19 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/Food/knows_its_name.yml b/test/cassettes/Food/knows_its_name.yml new file mode 100644 index 0000000..8f7a463 --- /dev/null +++ b/test/cassettes/Food/knows_its_name.yml @@ -0,0 +1,89 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/seattle-yoga-lounge-seattle + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="7c1e41719569e05e9edf549eddd4acbf", + oauth_signature="%2BHqOLuViqHcnZ6bzYcVAIMUf%2Bzk%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463930719", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + 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 15:25:20 GMT + Content-Type: + - application/json; charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=de97a21d611f4fb8580e2a9f6f1176e191463930719; expires=Mon, 22-May-17 + 15:25:19 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=89f6968fe89e3373fefa38b24b8e3fb5; Domain=.yelp.com; Path=/; HttpOnly + - yuv=zwM_2dzUQ8nliHhLr7LbxWB2Sh7diSRq8aPS6fZ0J8WimvPu3_zSW7rIblQXrVYpK5nPnBfLgYypG8CC6lV31bz3fcIDQyrR; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 15:25:19 + GMT + X-Node: + - api_com + - web6-r1-sfo2 + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Sun, 22 May 2016 15:25:19 GMT + Pragma: + - no-cache + Vary: + - Accept-Encoding,User-Agent + X-Mode: + - ro + X-Proxied: + - extlb8-r11-sfo2 + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7147b6f51329f5-SEA + body: + encoding: ASCII-8BIT + string: '{"is_claimed": true, "rating": 3.5, "mobile_url": "http://m.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "rating_img_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png", + "review_count": 92, "name": "Seattle Yoga Lounge", "rating_img_url_small": + "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/2e909d5d3536/ico/stars/v1/stars_small_3_half.png", + "url": "http://www.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "categories": [["Yoga", "yoga"]], "reviews": [{"rating": 4, "excerpt": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "time_created": 1459828326, "rating_image_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png", + "rating_image_small_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png", + "user": {"image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "id": "E3R2xduRKT1aaA6OZq9hSg", "name": "Jen T."}, "rating_image_large_url": + "https://s3-media2.fl.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png", + "id": "AUIhjm4OQAoshRwsJI_fRg"}], "phone": "2065234569", "snippet_text": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "image_url": "https://s3-media4.fl.yelpcdn.com/bphoto/dSbX4D2yBBYq4L7Y7g0yqQ/ms.jpg", + "snippet_image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "display_phone": "+1-206-523-4569", "rating_img_url_large": "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/bd9b7a815d1b/ico/stars/v1/stars_large_3_half.png", + "id": "seattle-yoga-lounge-seattle", "is_closed": false, "location": {"city": + "Seattle", "display_address": ["6900 E Greenlake Way", "Ste L", "Greenlake", + "Seattle, WA 98115"], "geo_accuracy": 9.5, "neighborhoods": ["Greenlake"], + "postal_code": "98115", "country_code": "US", "address": ["6900 E Greenlake + Way", "Ste L"], "coordinate": {"latitude": 47.678218, "longitude": -122.326477}, + "state_code": "WA"}}' + http_version: + recorded_at: Sun, 22 May 2016 15:25:20 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/Food/knows_its_rating.yml b/test/cassettes/Food/knows_its_rating.yml new file mode 100644 index 0000000..b1152e7 --- /dev/null +++ b/test/cassettes/Food/knows_its_rating.yml @@ -0,0 +1,89 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/seattle-yoga-lounge-seattle + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="63079fff3220d13f3f8e04e811539572", + oauth_signature="kLt%2F16ZqZEHcZ748cPzihwoG4%2Fk%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463930720", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + 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 15:25:20 GMT + Content-Type: + - application/json; charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d74803b15dc6249b1e08ba102e63e5b0d1463930720; expires=Mon, 22-May-17 + 15:25:20 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=5ea912be298393d6221757cea6ac0fe6; Domain=.yelp.com; Path=/; HttpOnly + - yuv=EBKTas8p_2Lv5jVrhayaycH5MNIVrxIMI7JOUwS-vl_1aQvfqflEZMWwqdCdHlEJDSrpwYW_Kc7HGjn44ZWk1z8-mLAT7708; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 15:25:20 + GMT + X-Node: + - api_com + - web58-r7-sfo2 + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Sun, 22 May 2016 15:25:20 GMT + Pragma: + - no-cache + Vary: + - Accept-Encoding,User-Agent + X-Mode: + - ro + X-Proxied: + - extlb8-r11-sfo2 + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7147b9570c2a37-SEA + body: + encoding: ASCII-8BIT + string: '{"is_claimed": true, "rating": 3.5, "mobile_url": "http://m.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "rating_img_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png", + "review_count": 92, "name": "Seattle Yoga Lounge", "rating_img_url_small": + "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/2e909d5d3536/ico/stars/v1/stars_small_3_half.png", + "url": "http://www.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "categories": [["Yoga", "yoga"]], "reviews": [{"rating": 4, "excerpt": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "time_created": 1459828326, "rating_image_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png", + "rating_image_small_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png", + "user": {"image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "id": "E3R2xduRKT1aaA6OZq9hSg", "name": "Jen T."}, "rating_image_large_url": + "https://s3-media2.fl.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png", + "id": "AUIhjm4OQAoshRwsJI_fRg"}], "phone": "2065234569", "snippet_text": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "image_url": "https://s3-media4.fl.yelpcdn.com/bphoto/dSbX4D2yBBYq4L7Y7g0yqQ/ms.jpg", + "snippet_image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "display_phone": "+1-206-523-4569", "rating_img_url_large": "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/bd9b7a815d1b/ico/stars/v1/stars_large_3_half.png", + "id": "seattle-yoga-lounge-seattle", "is_closed": false, "location": {"city": + "Seattle", "display_address": ["6900 E Greenlake Way", "Ste L", "Greenlake", + "Seattle, WA 98115"], "geo_accuracy": 9.5, "neighborhoods": ["Greenlake"], + "postal_code": "98115", "country_code": "US", "address": ["6900 E Greenlake + Way", "Ste L"], "coordinate": {"latitude": 47.678218, "longitude": -122.326477}, + "state_code": "WA"}}' + http_version: + recorded_at: Sun, 22 May 2016 15:25:20 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/Food/knows_its_rating_img_url_large.yml b/test/cassettes/Food/knows_its_rating_img_url_large.yml new file mode 100644 index 0000000..392a5ce --- /dev/null +++ b/test/cassettes/Food/knows_its_rating_img_url_large.yml @@ -0,0 +1,89 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/seattle-yoga-lounge-seattle + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="5fb5b08bf7be3a1f0d84943e4940aea8", + oauth_signature="on0x1JtAJAnyz55sQy70Q5jzKWg%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463930720", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + 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 15:25:21 GMT + Content-Type: + - application/json; charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d19494cc26fff96469883acda0f4535671463930720; expires=Mon, 22-May-17 + 15:25:20 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=43780df3a63da0447259f0f3fee1f131; Domain=.yelp.com; Path=/; HttpOnly + - yuv=-tuTGRcHrm0Sk_g3x3sYysD9Urxc8dD5Sx_guOeSryT-nuiKdD_NsLp74a7bVk3nqpYFtfsicFbckRp_KJ7iLb9nyntZyzKv; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 15:25:20 + GMT + X-Node: + - api_com + - web27-r5-sfo2 + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Sun, 22 May 2016 15:25:20 GMT + Pragma: + - no-cache + Vary: + - Accept-Encoding,User-Agent + X-Mode: + - ro + X-Proxied: + - extlb8-r11-sfo2 + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7147bdd8232aa3-SEA + body: + encoding: ASCII-8BIT + string: '{"is_claimed": true, "rating": 3.5, "mobile_url": "http://m.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "rating_img_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png", + "review_count": 92, "name": "Seattle Yoga Lounge", "rating_img_url_small": + "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/2e909d5d3536/ico/stars/v1/stars_small_3_half.png", + "url": "http://www.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "categories": [["Yoga", "yoga"]], "reviews": [{"rating": 4, "excerpt": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "time_created": 1459828326, "rating_image_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png", + "rating_image_small_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png", + "user": {"image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "id": "E3R2xduRKT1aaA6OZq9hSg", "name": "Jen T."}, "rating_image_large_url": + "https://s3-media2.fl.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png", + "id": "AUIhjm4OQAoshRwsJI_fRg"}], "phone": "2065234569", "snippet_text": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "image_url": "https://s3-media4.fl.yelpcdn.com/bphoto/dSbX4D2yBBYq4L7Y7g0yqQ/ms.jpg", + "snippet_image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "display_phone": "+1-206-523-4569", "rating_img_url_large": "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/bd9b7a815d1b/ico/stars/v1/stars_large_3_half.png", + "id": "seattle-yoga-lounge-seattle", "is_closed": false, "location": {"city": + "Seattle", "display_address": ["6900 E Greenlake Way", "Ste L", "Greenlake", + "Seattle, WA 98115"], "geo_accuracy": 9.5, "neighborhoods": ["Greenlake"], + "postal_code": "98115", "country_code": "US", "address": ["6900 E Greenlake + Way", "Ste L"], "coordinate": {"latitude": 47.678218, "longitude": -122.326477}, + "state_code": "WA"}}' + http_version: + recorded_at: Sun, 22 May 2016 15:25:21 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/Food/knows_its_review_count.yml b/test/cassettes/Food/knows_its_review_count.yml new file mode 100644 index 0000000..11345de --- /dev/null +++ b/test/cassettes/Food/knows_its_review_count.yml @@ -0,0 +1,89 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/seattle-yoga-lounge-seattle + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="5d5e8ef7975136280db71c4e7a289873", + oauth_signature="fgcHi4CbF3UFdPMiFSPOlBq8fGk%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463930720", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + 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 15:25:20 GMT + Content-Type: + - application/json; charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d1924b900d36ca4e9c6627fa37cee8eac1463930720; expires=Mon, 22-May-17 + 15:25:20 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=a21166787e7454a331eaa83258eb39c2; Domain=.yelp.com; Path=/; HttpOnly + - yuv=BHtCn8l__poE5XuySqFIg2G9QNAbn-e388V_R-qIgT2NDE9VEHz6JW-tCPjwp26hrKp2AUqIfiNqkTjSnTAv-rHTSGgtHs3C; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 15:25:20 + GMT + X-Node: + - 10-64-147-20-uswest1bprod + - api_com + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Sun, 22 May 2016 15:25:20 GMT + Pragma: + - no-cache + Vary: + - Accept-Encoding,User-Agent + X-Mode: + - ro + X-Proxied: + - 10-64-0-189-uswest1aprod + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7147bb15da0c47-SEA + body: + encoding: ASCII-8BIT + string: '{"is_claimed": true, "rating": 3.5, "mobile_url": "http://m.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "rating_img_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png", + "review_count": 92, "name": "Seattle Yoga Lounge", "rating_img_url_small": + "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/2e909d5d3536/ico/stars/v1/stars_small_3_half.png", + "url": "http://www.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "categories": [["Yoga", "yoga"]], "reviews": [{"rating": 4, "excerpt": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "time_created": 1459828326, "rating_image_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png", + "rating_image_small_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png", + "user": {"image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "id": "E3R2xduRKT1aaA6OZq9hSg", "name": "Jen T."}, "rating_image_large_url": + "https://s3-media2.fl.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png", + "id": "AUIhjm4OQAoshRwsJI_fRg"}], "phone": "2065234569", "snippet_text": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "image_url": "https://s3-media4.fl.yelpcdn.com/bphoto/dSbX4D2yBBYq4L7Y7g0yqQ/ms.jpg", + "snippet_image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "display_phone": "+1-206-523-4569", "rating_img_url_large": "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/bd9b7a815d1b/ico/stars/v1/stars_large_3_half.png", + "id": "seattle-yoga-lounge-seattle", "is_closed": false, "location": {"city": + "Seattle", "display_address": ["6900 E Greenlake Way", "Ste L", "Greenlake", + "Seattle, WA 98115"], "geo_accuracy": 9.5, "neighborhoods": ["Greenlake"], + "postal_code": "98115", "country_code": "US", "address": ["6900 E Greenlake + Way", "Ste L"], "coordinate": {"latitude": 47.678218, "longitude": -122.326477}, + "state_code": "WA"}}' + http_version: + recorded_at: Sun, 22 May 2016 15:25:20 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/Food/knows_that_it_has_an_image_url.yml b/test/cassettes/Food/knows_that_it_has_an_image_url.yml new file mode 100644 index 0000000..4396388 --- /dev/null +++ b/test/cassettes/Food/knows_that_it_has_an_image_url.yml @@ -0,0 +1,89 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/seattle-yoga-lounge-seattle + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="4246263d2f10219e35457372242e6981", + oauth_signature="mnup7XHM0Y1X0OBZYNx8zabNxl0%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463930721", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + 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 15:25:21 GMT + Content-Type: + - application/json; charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=db338ca33d47721bea363256d0191282e1463930721; expires=Mon, 22-May-17 + 15:25:21 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=ce1e7809cc2484f4aa798328764ac52f; Domain=.yelp.com; Path=/; HttpOnly + - yuv=W2Vwvwn4LhiQdZ4ZyLZysbnQS3PKjGnjnAIk2BvG33x0LVHJANrr-OGc58d5Zpa2O2ErruqRSwkCpTRjGow-grtGR7PDx4F5; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 15:25:21 + GMT + X-Node: + - api_com + - web3-r8-sfo2 + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Sun, 22 May 2016 15:25:21 GMT + Pragma: + - no-cache + Vary: + - Accept-Encoding,User-Agent + X-Mode: + - ro + X-Proxied: + - extlb8-r11-sfo2 + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7147bfc92a29f5-SEA + body: + encoding: ASCII-8BIT + string: '{"is_claimed": true, "rating": 3.5, "mobile_url": "http://m.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "rating_img_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png", + "review_count": 92, "name": "Seattle Yoga Lounge", "rating_img_url_small": + "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/2e909d5d3536/ico/stars/v1/stars_small_3_half.png", + "url": "http://www.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "categories": [["Yoga", "yoga"]], "reviews": [{"rating": 4, "excerpt": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "time_created": 1459828326, "rating_image_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png", + "rating_image_small_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png", + "user": {"image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "id": "E3R2xduRKT1aaA6OZq9hSg", "name": "Jen T."}, "rating_image_large_url": + "https://s3-media2.fl.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png", + "id": "AUIhjm4OQAoshRwsJI_fRg"}], "phone": "2065234569", "snippet_text": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "image_url": "https://s3-media4.fl.yelpcdn.com/bphoto/dSbX4D2yBBYq4L7Y7g0yqQ/ms.jpg", + "snippet_image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "display_phone": "+1-206-523-4569", "rating_img_url_large": "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/bd9b7a815d1b/ico/stars/v1/stars_large_3_half.png", + "id": "seattle-yoga-lounge-seattle", "is_closed": false, "location": {"city": + "Seattle", "display_address": ["6900 E Greenlake Way", "Ste L", "Greenlake", + "Seattle, WA 98115"], "geo_accuracy": 9.5, "neighborhoods": ["Greenlake"], + "postal_code": "98115", "country_code": "US", "address": ["6900 E Greenlake + Way", "Ste L"], "coordinate": {"latitude": 47.678218, "longitude": -122.326477}, + "state_code": "WA"}}' + http_version: + recorded_at: Sun, 22 May 2016 15:25:21 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/Food/knows_that_it_has_an_open_in_Yelp_url.yml b/test/cassettes/Food/knows_that_it_has_an_open_in_Yelp_url.yml new file mode 100644 index 0000000..2c06013 --- /dev/null +++ b/test/cassettes/Food/knows_that_it_has_an_open_in_Yelp_url.yml @@ -0,0 +1,89 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/seattle-yoga-lounge-seattle + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="281a7c3fac5cee9745ed73eba8168030", + oauth_signature="LUtnzd6DORN%2FxEHtC6UU5ENiC08%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463930720", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + 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 15:25:20 GMT + Content-Type: + - application/json; charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d948282bc10f68e9a06cd8f1f7a9867e61463930720; expires=Mon, 22-May-17 + 15:25:20 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=4404f0adbaa3798b75b7d5d0ebcb1087; Domain=.yelp.com; Path=/; HttpOnly + - yuv=EH9NrM6wwp9RhgL3ebWUinvyrOPowziZwL6-ZnZ7zi77E1mS4bsHTfDhOsSiquTvj7vsWLeBV5Y6dY71M0zQbWogaIqHOjxx; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sat, 17-May-2036 15:25:20 + GMT + X-Node: + - 10-64-100-95-uswest1aprod + - api_com + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Sun, 22 May 2016 15:25:20 GMT + Pragma: + - no-cache + Vary: + - Accept-Encoding,User-Agent + X-Mode: + - ro + X-Proxied: + - 10-64-0-189-uswest1aprod + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7147bc5ffc2a1f-SEA + body: + encoding: ASCII-8BIT + string: '{"is_claimed": true, "rating": 3.5, "mobile_url": "http://m.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "rating_img_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/5ef3eb3cb162/ico/stars/v1/stars_3_half.png", + "review_count": 92, "name": "Seattle Yoga Lounge", "rating_img_url_small": + "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/2e909d5d3536/ico/stars/v1/stars_small_3_half.png", + "url": "http://www.yelp.com/biz/seattle-yoga-lounge-seattle?utm_campaign=yelp_api\u0026utm_medium=api_v2_business\u0026utm_source=_R_trNFDzsAcX3LXtO1Kzw", + "categories": [["Yoga", "yoga"]], "reviews": [{"rating": 4, "excerpt": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "time_created": 1459828326, "rating_image_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/c2f3dd9799a5/ico/stars/v1/stars_4.png", + "rating_image_small_url": "https://s3-media4.fl.yelpcdn.com/assets/2/www/img/f62a5be2f902/ico/stars/v1/stars_small_4.png", + "user": {"image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "id": "E3R2xduRKT1aaA6OZq9hSg", "name": "Jen T."}, "rating_image_large_url": + "https://s3-media2.fl.yelpcdn.com/assets/2/www/img/ccf2b76faa2c/ico/stars/v1/stars_large_4.png", + "id": "AUIhjm4OQAoshRwsJI_fRg"}], "phone": "2065234569", "snippet_text": "Such + a great studio! Elvis and his team are so welcoming and wonderful. I have + taken several classes here via Class Pass and have thoroughly enjoyed them...", + "image_url": "https://s3-media4.fl.yelpcdn.com/bphoto/dSbX4D2yBBYq4L7Y7g0yqQ/ms.jpg", + "snippet_image_url": "http://s3-media3.fl.yelpcdn.com/photo/HJBuXQsDvOwKywgZgsdCKQ/ms.jpg", + "display_phone": "+1-206-523-4569", "rating_img_url_large": "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/bd9b7a815d1b/ico/stars/v1/stars_large_3_half.png", + "id": "seattle-yoga-lounge-seattle", "is_closed": false, "location": {"city": + "Seattle", "display_address": ["6900 E Greenlake Way", "Ste L", "Greenlake", + "Seattle, WA 98115"], "geo_accuracy": 9.5, "neighborhoods": ["Greenlake"], + "postal_code": "98115", "country_code": "US", "address": ["6900 E Greenlake + Way", "Ste L"], "coordinate": {"latitude": 47.678218, "longitude": -122.326477}, + "state_code": "WA"}}' + http_version: + recorded_at: Sun, 22 May 2016 15:25:20 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/album/knows_its_name.yml b/test/cassettes/album/knows_its_name.yml new file mode 100644 index 0000000..1f3ce42 --- /dev/null +++ b/test/cassettes/album/knows_its_name.yml @@ -0,0 +1,132 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/albums/1Frb2yxLXQSaMzqnfCB1Dx + 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 07:13:13 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 |- + H4sIAAAAAAAAAOydW08jO7aA3/evKPEw2lvq3vhuV0ujI8K9S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lhMkWNaxQjnU1sMCkKq0KIhVUV2C+AN4A3g/eDgRZcXZFteZrKy9xAf + n16lGf12vBx4Z6ic2F6dI/Ze8JZzTQDkJMUKQ6e1MMgpJvOXjjhIGAdQO2lj + pnDRSdaisVVFlhp7+Uqr2R49LfTxIVpJ8idlmJHk/fOYlTrXtT7zSch/vrTf + fSXYS3uyNWr1L49Pw0+Eaql+27d6Ek3Doi9wK1Po/q56flSXtYebxK1X4Mbd + yi9//h8AAAD//wMA1S+d4mOXAAA= + http_version: + recorded_at: Sun, 22 May 2016 07:13:12 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/album/knows_its_type.yml b/test/cassettes/album/knows_its_type.yml new file mode 100644 index 0000000..cd46642 --- /dev/null +++ b/test/cassettes/album/knows_its_type.yml @@ -0,0 +1,132 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/albums/1Frb2yxLXQSaMzqnfCB1Dx + 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 07:13:13 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 |- + H4sIAAAAAAAAAOydW08jO7aA3/evKPEw2lvq3vhuV0ujI8K9SbgFaJrRqOUr + CSRVoZIQYGv/mPkN83Ze9x87FQdCQ5IKJDN1eHC32qTtlWXHq9bn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x4Z6ic2F6dI/Ze8JZzTQDkJMUKQ6e1MMgpJvOXjjhIGAdQO2lj + pnDRSdaisVVFlhp7+Uqr2R49LfTxIVpJ8idlmJHk/fOYlTrXtT7zSch/vrTf + fSXYS3uyNWr1L49Pw0+Eaql+27d6Ek3Doi9wK1Po/q56flSXtYebxK1X4Mbd + yi9//h8AAAD//wMA1S+d4mOXAAA= + http_version: + recorded_at: Sun, 22 May 2016 07:13:13 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/album/knows_that_it_has_an_image_url.yml b/test/cassettes/album/knows_that_it_has_an_image_url.yml new file mode 100644 index 0000000..1f3ce42 --- /dev/null +++ b/test/cassettes/album/knows_that_it_has_an_image_url.yml @@ -0,0 +1,132 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/albums/1Frb2yxLXQSaMzqnfCB1Dx + 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 07:13:13 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 |- + H4sIAAAAAAAAAOydW08jO7aA3/evKPEw2lvq3vhuV0ujI8K9SbgFaJrRqOUr + CSRVoZIQYGv/mPkN83Ze9x87FQdCQ5IKJDN1eHC32qTtlWXHq9bn6wp//BJF + K7Kl+u0fvfuOXYm+PP535ZMvyXrNb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JvOXjjhIGAdQO2lj + pnDRSdaisVVFlhp7+Uqr2R49LfTxIVpJ8idlmJHk/fOYlTrXtT7zSch/vrTf + fSXYS3uyNWr1L49Pw0+Eaql+27d6Ek3Doi9wK1Po/q56flSXtYebxK1X4Mbd + yi9//h8AAAD//wMA1S+d4mOXAAA= + http_version: + recorded_at: Sun, 22 May 2016 07:13:12 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/album/knows_that_it_has_an_open_in_spotify_url.yml b/test/cassettes/album/knows_that_it_has_an_open_in_spotify_url.yml new file mode 100644 index 0000000..cd46642 --- /dev/null +++ b/test/cassettes/album/knows_that_it_has_an_open_in_spotify_url.yml @@ -0,0 +1,132 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/albums/1Frb2yxLXQSaMzqnfCB1Dx + 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 07:13:13 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 |- + H4sIAAAAAAAAAOydW08jO7aA3/evKPEw2lvq3vhuV0ujI8K9SbgFaJrRqOUr + CSRVoZIQYGv/mPkN83Ze9x87FQdCQ5IKJDN1eHC32qTtlWXHq9bn6wp//BJF + K7Kl+u0fvfuOXYm+PP535ZMvyXrNbq87zP5H9Eeek+fZu57NEtn60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SdaisVVFlhp7+Uqr2R49LfTxIVpJ8idlmJHk/fOYlTrXtT7zSch/vrTf + fSXYS3uyNWr1L49Pw0+Eaql+27d6Ek3Doi9wK1Po/q56flSXtYebxK1X4Mbd + yi9//h8AAAD//wMA1S+d4mOXAAA= + http_version: + recorded_at: Sun, 22 May 2016 07:13:13 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/artist/knows_its_name.yml b/test/cassettes/artist/knows_its_name.yml new file mode 100644 index 0000000..b530ab4 --- /dev/null +++ b/test/cassettes/artist/knows_its_name.yml @@ -0,0 +1,130 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4 + 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 07:13:12 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 |- + H4sIAAAAAAAAAHyQSwvCMBCE7/6K0LNYKj315smDICI+QBEJNdXo5kGyUWvp + f7dNquhBj/vtzOywVY+QiN2RGUlh7wzYiGSkamjDrVbIi7Il0QlR2yyOlWZy + 0C0GuRIxNcgtxslZpqPF8DyeCFiuNmvhHtNZGjVBdb+9USgAdWPmM/9kWNGO + 0gH0A0KFFFqWvp1HJg3zti3ZefLyvUtRzb86XZOulv3Vy+fwg0/5KxH0+H1c + UsG8bc7zS0kWNFdBqpV2QA1H/7DEMyx1EIc6QegM96xrnIVd9uuD9RMAAP// + AwBmqBvMpAEAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:13:12 GMT +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4/albums?limit=20&offset=0 + 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 07:13:12 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 |- + H4sIAAAAAAAAAIxU207bQBB95ysiP/AU4Ut8SyRUQQJJShIiQkJLVUUb75gs + 9U32Oi1F/HvXx4YqUmh5OdqdmT3n7Oxon49aLW2bU6i1emohZVb0dJ1l4qTI + UinCp5MgjfWdqbNcikIWuvmY2Ge31uPwKo6Wq/u7uPw9m9s6izZlXHxKw7Ag + eWocRyIW8tQyjpFYy6eMTguRPETURqStaDMRMSnSpM2yjFherNWSMq1dWRKS + 4qLy9K31rPYq8pcIVrFFbZXbMcW1iWgds/wHyeakdnajtRUugbcVnl8Ar4HI + ng8r7J8BJ0Bk+8j2vwLvKxxcAZEdgOeiD8R6sarwcgzE2WGN0B3NgGAYwc94 + AcTZMWomYJjUa9RMoT5FZPqlwhkczuBnBq0Z/Mzhf476OTjnIyDq52BY4KYL + eLiA+gKVfVTe3gHheQmeJWqG5+jeAK6gOMWtxwOt9b3pP/2SlCcsWpd5hN7X + b6YyzRTtTVeaUbI3XnhL3Znwkk9W19utH48/r25iyzaXlxqYXhqhD00qRvE9 + uoZIcND8pyhmD7Q3hZUFEg9bWQVd22i/RtXF93wpVwFPlCUdJPrGtAOfsZDZ + ru+6Hc8nTjzkXXJ8ChyLPHICCv2u9sb4U3C5bWSaHhwy0TE+bsLwHdO2A6Pj + uaa3cSzHUOqG5zkmkcM6XZMHrmsy64AJJfMPE679YQ+mv7GVstMJlLJL9sbm + vud3beLctDizlTXmccM52IjawtvYJSyuP4ORMkJ5a0I7il4f7/BPUeYCwWZm + ekj23h+9RkzDf1adtNBuLVEjX22TMooQqH++KlQXZDntRFoWe0UylQztMY9e + /gAAAP//AwDCP13JegUAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:13:12 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/artist/knows_its_type.yml b/test/cassettes/artist/knows_its_type.yml new file mode 100644 index 0000000..ef0f2e5 --- /dev/null +++ b/test/cassettes/artist/knows_its_type.yml @@ -0,0 +1,130 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4 + 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 07:13:11 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 |- + H4sIAAAAAAAAAHyQSwvCMBCE7/6K0LNYKj315smDICI+QBEJNdXo5kGyUWvp + f7dNquhBj/vtzOywVY+QiN2RGUlh7wzYiGSkamjDrVbIi7Il0QlR2yyOlWZy + 0C0GuRIxNcgtxslZpqPF8DyeCFiuNmvhHtNZGjVBdb+9USgAdWPmM/9kWNGO + 0gH0A0KFFFqWvp1HJg3zti3ZefLyvUtRzb86XZOulv3Vy+fwg0/5KxH0+H1c + UsG8bc7zS0kWNFdBqpV2QA1H/7DEMyx1EIc6QegM96xrnIVd9uuD9RMAAP// + AwBmqBvMpAEAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:13:11 GMT +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4/albums?limit=20&offset=0 + 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 07:13:11 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 |- + H4sIAAAAAAAAAIxU207bQBB95ysiP/AU4Ut8SyRUQQJJShIiQkJLVUUb75gs + 9U32Oi1F/HvXx4YqUmh5OdqdmT3n7Oxon49aLW2bU6i1emohZVb0dJ1l4qTI + UinCp5MgjfWdqbNcikIWuvmY2Ge31uPwKo6Wq/u7uPw9m9s6izZlXHxKw7Ag + eWocRyIW8tQyjpFYy6eMTguRPETURqStaDMRMSnSpM2yjFherNWSMq1dWRKS + 4qLy9K31rPYq8pcIVrFFbZXbMcW1iWgds/wHyeakdnajtRUugbcVnl8Ar4HI + ng8r7J8BJ0Bk+8j2vwLvKxxcAZEdgOeiD8R6sarwcgzE2WGN0B3NgGAYwc94 + AcTZMWomYJjUa9RMoT5FZPqlwhkczuBnBq0Z/Mzhf476OTjnIyDq52BY4KYL + eLiA+gKVfVTe3gHheQmeJWqG5+jeAK6gOMWtxwOt9b3pP/2SlCcsWpd5hN7X + b6YyzRTtTVeaUbI3XnhL3Znwkk9W19utH48/r25iyzaXlxqYXhqhD00qRvE9 + uoZIcND8pyhmD7Q3hZUFEg9bWQVd22i/RtXF93wpVwFPlCUdJPrGtAOfsZDZ + ru+6Hc8nTjzkXXJ8ChyLPHICCv2u9sb4U3C5bWSaHhwy0TE+bsLwHdO2A6Pj + uaa3cSzHUOqG5zkmkcM6XZMHrmsy64AJJfMPE679YQ+mv7GVstMJlLJL9sbm + vud3beLctDizlTXmccM52IjawtvYJSyuP4ORMkJ5a0I7il4f7/BPUeYCwWZm + ekj23h+9RkzDf1adtNBuLVEjX22TMooQqH++KlQXZDntRFoWe0UylQztMY9e + /gAAAP//AwDCP13JegUAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:13:11 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/artist/knows_that_it_has_an_image_url.yml b/test/cassettes/artist/knows_that_it_has_an_image_url.yml new file mode 100644 index 0000000..b530ab4 --- /dev/null +++ b/test/cassettes/artist/knows_that_it_has_an_image_url.yml @@ -0,0 +1,130 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4 + 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 07:13:12 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 |- + H4sIAAAAAAAAAHyQSwvCMBCE7/6K0LNYKj315smDICI+QBEJNdXo5kGyUWvp + f7dNquhBj/vtzOywVY+QiN2RGUlh7wzYiGSkamjDrVbIi7Il0QlR2yyOlWZy + 0C0GuRIxNcgtxslZpqPF8DyeCFiuNmvhHtNZGjVBdb+9USgAdWPmM/9kWNGO + 0gH0A0KFFFqWvp1HJg3zti3ZefLyvUtRzb86XZOulv3Vy+fwg0/5KxH0+H1c + UsG8bc7zS0kWNFdBqpV2QA1H/7DEMyx1EIc6QegM96xrnIVd9uuD9RMAAP// + AwBmqBvMpAEAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:13:12 GMT +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4/albums?limit=20&offset=0 + 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 07:13:12 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 |- + H4sIAAAAAAAAAIxU207bQBB95ysiP/AU4Ut8SyRUQQJJShIiQkJLVUUb75gs + 9U32Oi1F/HvXx4YqUmh5OdqdmT3n7Oxon49aLW2bU6i1emohZVb0dJ1l4qTI + UinCp5MgjfWdqbNcikIWuvmY2Ge31uPwKo6Wq/u7uPw9m9s6izZlXHxKw7Ag + eWocRyIW8tQyjpFYy6eMTguRPETURqStaDMRMSnSpM2yjFherNWSMq1dWRKS + 4qLy9K31rPYq8pcIVrFFbZXbMcW1iWgds/wHyeakdnajtRUugbcVnl8Ar4HI + ng8r7J8BJ0Bk+8j2vwLvKxxcAZEdgOeiD8R6sarwcgzE2WGN0B3NgGAYwc94 + AcTZMWomYJjUa9RMoT5FZPqlwhkczuBnBq0Z/Mzhf476OTjnIyDq52BY4KYL + eLiA+gKVfVTe3gHheQmeJWqG5+jeAK6gOMWtxwOt9b3pP/2SlCcsWpd5hN7X + b6YyzRTtTVeaUbI3XnhL3Znwkk9W19utH48/r25iyzaXlxqYXhqhD00qRvE9 + uoZIcND8pyhmD7Q3hZUFEg9bWQVd22i/RtXF93wpVwFPlCUdJPrGtAOfsZDZ + ru+6Hc8nTjzkXXJ8ChyLPHICCv2u9sb4U3C5bWSaHhwy0TE+bsLwHdO2A6Pj + uaa3cSzHUOqG5zkmkcM6XZMHrmsy64AJJfMPE679YQ+mv7GVstMJlLJL9sbm + vud3beLctDizlTXmccM52IjawtvYJSyuP4ORMkJ5a0I7il4f7/BPUeYCwWZm + ekj23h+9RkzDf1adtNBuLVEjX22TMooQqH++KlQXZDntRFoWe0UylQztMY9e + /gAAAP//AwDCP13JegUAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:13:12 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/artist/knows_that_it_has_an_open_in_spotify_url.yml b/test/cassettes/artist/knows_that_it_has_an_open_in_spotify_url.yml new file mode 100644 index 0000000..55d793f --- /dev/null +++ b/test/cassettes/artist/knows_that_it_has_an_open_in_spotify_url.yml @@ -0,0 +1,130 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4 + 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 07:13:12 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 |- + H4sIAAAAAAAAAHyQSwvCMBCE7/6K0LNYKj315smDICI+QBEJNdXo5kGyUWvp + f7dNquhBj/vtzOywVY+QiN2RGUlh7wzYiGSkamjDrVbIi7Il0QlR2yyOlWZy + 0C0GuRIxNcgtxslZpqPF8DyeCFiuNmvhHtNZGjVBdb+9USgAdWPmM/9kWNGO + 0gH0A0KFFFqWvp1HJg3zti3ZefLyvUtRzb86XZOulv3Vy+fwg0/5KxH0+H1c + UsG8bc7zS0kWNFdBqpV2QA1H/7DEMyx1EIc6QegM96xrnIVd9uuD9RMAAP// + AwBmqBvMpAEAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:13:11 GMT +- request: + method: get + uri: https://api.spotify.com/v1/artists/1jn4AT2jGKmlUVZWmuzNP4/albums?limit=20&offset=0 + 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 07:13:12 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 |- + H4sIAAAAAAAAAIxU207bQBB95ysiP/AU4Ut8SyRUQQJJShIiQkJLVUUb75gs + 9U32Oi1F/HvXx4YqUmh5OdqdmT3n7Oxon49aLW2bU6i1emohZVb0dJ1l4qTI + UinCp5MgjfWdqbNcikIWuvmY2Ge31uPwKo6Wq/u7uPw9m9s6izZlXHxKw7Ag + eWocRyIW8tQyjpFYy6eMTguRPETURqStaDMRMSnSpM2yjFherNWSMq1dWRKS + 4qLy9K31rPYq8pcIVrFFbZXbMcW1iWgds/wHyeakdnajtRUugbcVnl8Ar4HI + ng8r7J8BJ0Bk+8j2vwLvKxxcAZEdgOeiD8R6sarwcgzE2WGN0B3NgGAYwc94 + AcTZMWomYJjUa9RMoT5FZPqlwhkczuBnBq0Z/Mzhf476OTjnIyDq52BY4KYL + eLiA+gKVfVTe3gHheQmeJWqG5+jeAK6gOMWtxwOt9b3pP/2SlCcsWpd5hN7X + b6YyzRTtTVeaUbI3XnhL3Znwkk9W19utH48/r25iyzaXlxqYXhqhD00qRvE9 + uoZIcND8pyhmD7Q3hZUFEg9bWQVd22i/RtXF93wpVwFPlCUdJPrGtAOfsZDZ + ru+6Hc8nTjzkXXJ8ChyLPHICCv2u9sb4U3C5bWSaHhwy0TE+bsLwHdO2A6Pj + uaa3cSzHUOqG5zkmkcM6XZMHrmsy64AJJfMPE679YQ+mv7GVstMJlLJL9sbm + vud3beLctDizlTXmccM52IjawtvYJSyuP4ORMkJ5a0I7il4f7/BPUeYCwWZm + ekj23h+9RkzDf1adtNBuLVEjX22TMooQqH++KlQXZDntRFoWe0UylQztMY9e + /gAAAP//AwDCP13JegUAAA== + http_version: + recorded_at: Sun, 22 May 2016 07:13:11 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/invalid_Food/knows_its_display_phone.yml b/test/cassettes/invalid_Food/knows_its_display_phone.yml new file mode 100644 index 0000000..3a5bcc3 --- /dev/null +++ b/test/cassettes/invalid_Food/knows_its_display_phone.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/melissa-jimison + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="16c6ab7cc6d242be93c234f2eee6a705", + oauth_signature="3Kud4HcDEqXOIX1CnzScGUIbvLs%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463975213", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + oauth_version="1.0" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Mon, 23 May 2016 03:46:53 GMT + Content-Type: + - application/json; charset=UTF-8 + Content-Length: + - '88' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d1f8db56087c56ad75a905831e38b446c1463975213; expires=Tue, 23-May-17 + 03:46:53 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=ea08a286578b8b0c1fdb7c8e988463ec; Domain=.yelp.com; Path=/; HttpOnly + - yuv=Htf96y8TiTHcv1SNi6rZgxMyOC1mzng7t85emmCqTgTcV_IuFJ6vVKDDTULQqUmfUG9xfiDM1GifuF669K30QC7lu5jzoicy; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sun, 18-May-2036 03:46:53 + GMT + X-Node: + - 10-64-147-196-uswest1bprod + - api_com + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Mon, 23 May 2016 03:46:53 GMT + Pragma: + - no-cache + Vary: + - User-Agent + X-Mode: + - ro + X-Proxied: + - 10-64-16-56-uswest1bprod + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7585fe8abb2a1f-SEA + body: + encoding: UTF-8 + string: '{"error": {"text": "Business information is unavailable", "id": "BUSINESS_UNAVAILABLE"}}' + http_version: + recorded_at: Mon, 23 May 2016 03:46:53 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/invalid_Food/knows_that_it_has_an_open_in_Yelp_url.yml b/test/cassettes/invalid_Food/knows_that_it_has_an_open_in_Yelp_url.yml new file mode 100644 index 0000000..31e0848 --- /dev/null +++ b/test/cassettes/invalid_Food/knows_that_it_has_an_open_in_Yelp_url.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.yelp.com/v2/business/melissa-jimison + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Faraday v0.9.2 + Authorization: + - OAuth oauth_consumer_key="_R_trNFDzsAcX3LXtO1Kzw", oauth_nonce="4cc77b960e3b9e2b5f6e0b5e030e0a9d", + oauth_signature="sfqBUyubX2WD0agE4lk6DsPG0QA%3D", oauth_signature_method="HMAC-SHA1", + oauth_timestamp="1463975213", oauth_token="g6Y2ohxxC7p1bt58iY_a7i8ojXlKZaVd", + oauth_version="1.0" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Mon, 23 May 2016 03:46:53 GMT + Content-Type: + - application/json; charset=UTF-8 + Content-Length: + - '88' + Connection: + - keep-alive + Set-Cookie: + - __cfduid=d678ea33907170168de511fb341f6d88e1463975213; expires=Tue, 23-May-17 + 03:46:53 GMT; path=/; domain=.yelp.com; HttpOnly + - bse=49da05d62ebfd3e460df1b26b2b2d59d; Domain=.yelp.com; Path=/; HttpOnly + - yuv=7FBTZ41PRTbjVGg3w16ODd2muuBK1SthCkY4jG404niuZLDyIufRqJPArGyqkGpacBIuGEe5NnwAaAqQ2t0wd8LXvsYRco3W; + Domain=.yelp.com; Max-Age=630720000; Path=/; expires=Sun, 18-May-2036 03:46:53 + GMT + X-Node: + - 10-64-104-116-uswest1aprod + - api_com + Cache-Control: + - max-age=0, must-revalidate, no-cache, no-store, private + Expires: + - Mon, 23 May 2016 03:46:53 GMT + Pragma: + - no-cache + Vary: + - User-Agent + X-Mode: + - ro + X-Proxied: + - 10-64-0-189-uswest1aprod + Server: + - cloudflare-nginx + Cf-Ray: + - 2a7585fd3dfd1bc1-SEA + body: + encoding: UTF-8 + string: '{"error": {"text": "Business information is unavailable", "id": "BUSINESS_UNAVAILABLE"}}' + http_version: + recorded_at: Mon, 23 May 2016 03:46:53 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/track/knows_its_name.yml b/test/cassettes/track/knows_its_name.yml new file mode 100644 index 0000000..ade6237 --- /dev/null +++ b/test/cassettes/track/knows_its_name.yml @@ -0,0 +1,71 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/tracks/0FC7X3BRdEJC8L4ZEUAv2Q + 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 07:24:56 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 |- + H4sIAAAAAAAAAKRU21LbMBB971d49EyxZNmynTdgKAyFTrmkpe10MmtLjjX4 + VtkOpAz/XkcWpgGcpu1LZry7OXt2z1ndv7EsBFnU5siaWPfd1+P3rFlWYhVE + tSzmmUA7JrkAmUGUiVkO6kY09armm4UO9tCOhc6uV7/TS2R9N/XirhGqgGzW + qqx+atJl6qpsZLLUPdKmqeqJbZeVKHZNYjcuc1tzsV32Q5UXV8tPy+NMXXHy + 87Q+PlJIIz2YRqkSyRoWVHINakF6tHoMzgBJrmH+UJTDXJjZh4lSIedpswoy + F+88RrvB13h1rGJedJRsDWI7OHG5H0Q+x46HIw5u5FCH+SEFzgh4PgYnDhyM + BsRbyZvUtDE7eI0ExduT4KHnBiF3IMRemGCHJpR5BEjUtQBBOGdxANQVr5Do + 2mwgwdytOQQuDmkCXhDExKFxgkNOQxz5BES3IBEw18Exi15fRE9hsF0Bee/e + /VIV1lUqa+szLB/VG7zdW99EWyV7w/emmejkZNx72nkIVCPrZs0K/216DWmT + 4y/OCccf8o8t5JfpnmLvz/L6H1zfMxzDW7f95qJhrafAl9YRzOHlSnW30Z3q + 7GR8NCPh370ziMs6nhVtHgm1qiN9sFXQyLKY5frPDsMuYzoj7qpMxlIbNIGs + FiZqVJP8N9GQrFWsZ5heTs98QjBmNHjSf0Tr7ZRuFMQ3Nn534F/T/Qt+eHIQ + nLpfD6d7C+f8qcU2ImukegxKwxiFN5VsOBtUlVWbgZKNnsntd1wpsZDidvb8 + tqvhtvOKvjVVdgRxSH3qCe5gcKmf4O5ZoVFAfBKL7siZl3RPHfQXjvRIL1Qd + jKbTfeVzl+nUZGytD78AAAD//wMAHp4iD/YGAAA= + http_version: + recorded_at: Sun, 22 May 2016 07:24:56 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/track/knows_its_type.yml b/test/cassettes/track/knows_its_type.yml new file mode 100644 index 0000000..036b24b --- /dev/null +++ b/test/cassettes/track/knows_its_type.yml @@ -0,0 +1,71 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/tracks/0FC7X3BRdEJC8L4ZEUAv2Q + 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 07:24:55 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 |- + H4sIAAAAAAAAAKRU21LbMBB971d49EyxZNmynTdgKAyFTrmkpe10MmtLjjX4 + VtkOpAz/XkcWpgGcpu1LZry7OXt2z1ndv7EsBFnU5siaWPfd1+P3rFlWYhVE + tSzmmUA7JrkAmUGUiVkO6kY09armm4UO9tCOhc6uV7/TS2R9N/XirhGqgGzW + qqx+atJl6qpsZLLUPdKmqeqJbZeVKHZNYjcuc1tzsV32Q5UXV8tPy+NMXXHy + 87Q+PlJIIz2YRqkSyRoWVHINakF6tHoMzgBJrmH+UJTDXJjZh4lSIedpswoy + F+88RrvB13h1rGJedJRsDWI7OHG5H0Q+x46HIw5u5FCH+SEFzgh4PgYnDhyM + BsRbyZvUtDE7eI0ExduT4KHnBiF3IMRemGCHJpR5BEjUtQBBOGdxANQVr5Do + 2mwgwdytOQQuDmkCXhDExKFxgkNOQxz5BES3IBEw18Exi15fRE9hsF0Bee/e + /VIV1lUqa+szLB/VG7zdW99EWyV7w/emmejkZNx72nkIVCPrZs0K/216DWmT + 4y/OCccf8o8t5JfpnmLvz/L6H1zfMxzDW7f95qJhrafAl9YRzOHlSnW30Z3q + 7GR8NCPh370ziMs6nhVtHgm1qiN9sFXQyLKY5frPDsMuYzoj7qpMxlIbNIGs + FiZqVJP8N9GQrFWsZ5heTs98QjBmNHjSf0Tr7ZRuFMQ3Nn534F/T/Qt+eHIQ + nLpfD6d7C+f8qcU2ImukegxKwxiFN5VsOBtUlVWbgZKNnsntd1wpsZDidvb8 + tqvhtvOKvjVVdgRxSH3qCe5gcKmf4O5ZoVFAfBKL7siZl3RPHfQXjvRIL1Qd + jKbTfeVzl+nUZGytD78AAAD//wMAHp4iD/YGAAA= + http_version: + recorded_at: Sun, 22 May 2016 07:24:55 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/track/knows_that_it_has_an_image_url.yml b/test/cassettes/track/knows_that_it_has_an_image_url.yml new file mode 100644 index 0000000..ade6237 --- /dev/null +++ b/test/cassettes/track/knows_that_it_has_an_image_url.yml @@ -0,0 +1,71 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/tracks/0FC7X3BRdEJC8L4ZEUAv2Q + 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 07:24:56 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 |- + H4sIAAAAAAAAAKRU21LbMBB971d49EyxZNmynTdgKAyFTrmkpe10MmtLjjX4 + VtkOpAz/XkcWpgGcpu1LZry7OXt2z1ndv7EsBFnU5siaWPfd1+P3rFlWYhVE + tSzmmUA7JrkAmUGUiVkO6kY09armm4UO9tCOhc6uV7/TS2R9N/XirhGqgGzW + qqx+atJl6qpsZLLUPdKmqeqJbZeVKHZNYjcuc1tzsV32Q5UXV8tPy+NMXXHy + 87Q+PlJIIz2YRqkSyRoWVHINakF6tHoMzgBJrmH+UJTDXJjZh4lSIedpswoy + F+88RrvB13h1rGJedJRsDWI7OHG5H0Q+x46HIw5u5FCH+SEFzgh4PgYnDhyM + BsRbyZvUtDE7eI0ExduT4KHnBiF3IMRemGCHJpR5BEjUtQBBOGdxANQVr5Do + 2mwgwdytOQQuDmkCXhDExKFxgkNOQxz5BES3IBEw18Exi15fRE9hsF0Bee/e + /VIV1lUqa+szLB/VG7zdW99EWyV7w/emmejkZNx72nkIVCPrZs0K/216DWmT + 4y/OCccf8o8t5JfpnmLvz/L6H1zfMxzDW7f95qJhrafAl9YRzOHlSnW30Z3q + 7GR8NCPh370ziMs6nhVtHgm1qiN9sFXQyLKY5frPDsMuYzoj7qpMxlIbNIGs + FiZqVJP8N9GQrFWsZ5heTs98QjBmNHjSf0Tr7ZRuFMQ3Nn534F/T/Qt+eHIQ + nLpfD6d7C+f8qcU2ImukegxKwxiFN5VsOBtUlVWbgZKNnsntd1wpsZDidvb8 + tqvhtvOKvjVVdgRxSH3qCe5gcKmf4O5ZoVFAfBKL7siZl3RPHfQXjvRIL1Qd + jKbTfeVzl+nUZGytD78AAAD//wMAHp4iD/YGAAA= + http_version: + recorded_at: Sun, 22 May 2016 07:24:56 GMT +recorded_with: VCR 3.0.1 diff --git a/test/cassettes/track/knows_that_it_has_an_open_in_spotify_url.yml b/test/cassettes/track/knows_that_it_has_an_open_in_spotify_url.yml new file mode 100644 index 0000000..ade6237 --- /dev/null +++ b/test/cassettes/track/knows_that_it_has_an_open_in_spotify_url.yml @@ -0,0 +1,71 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.spotify.com/v1/tracks/0FC7X3BRdEJC8L4ZEUAv2Q + 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 07:24:56 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 |- + H4sIAAAAAAAAAKRU21LbMBB971d49EyxZNmynTdgKAyFTrmkpe10MmtLjjX4 + VtkOpAz/XkcWpgGcpu1LZry7OXt2z1ndv7EsBFnU5siaWPfd1+P3rFlWYhVE + tSzmmUA7JrkAmUGUiVkO6kY09armm4UO9tCOhc6uV7/TS2R9N/XirhGqgGzW + qqx+atJl6qpsZLLUPdKmqeqJbZeVKHZNYjcuc1tzsV32Q5UXV8tPy+NMXXHy + 87Q+PlJIIz2YRqkSyRoWVHINakF6tHoMzgBJrmH+UJTDXJjZh4lSIedpswoy + F+88RrvB13h1rGJedJRsDWI7OHG5H0Q+x46HIw5u5FCH+SEFzgh4PgYnDhyM + BsRbyZvUtDE7eI0ExduT4KHnBiF3IMRemGCHJpR5BEjUtQBBOGdxANQVr5Do + 2mwgwdytOQQuDmkCXhDExKFxgkNOQxz5BES3IBEw18Exi15fRE9hsF0Bee/e + /VIV1lUqa+szLB/VG7zdW99EWyV7w/emmejkZNx72nkIVCPrZs0K/216DWmT + 4y/OCccf8o8t5JfpnmLvz/L6H1zfMxzDW7f95qJhrafAl9YRzOHlSnW30Z3q + 7GR8NCPh370ziMs6nhVtHgm1qiN9sFXQyLKY5frPDsMuYzoj7qpMxlIbNIGs + FiZqVJP8N9GQrFWsZ5heTs98QjBmNHjSf0Tr7ZRuFMQ3Nn534F/T/Qt+eHIQ + nLpfD6d7C+f8qcU2ImukegxKwxiFN5VsOBtUlVWbgZKNnsntd1wpsZDidvb8 + tqvhtvOKvjVVdgRxSH3qCe5gcKmf4O5ZoVFAfBKL7siZl3RPHfQXjvRIL1Qd + jKbTfeVzl+nUZGytD78AAAD//wMAHp4iD/YGAAA= + http_version: + recorded_at: Sun, 22 May 2016 07:24:56 GMT +recorded_with: VCR 3.0.1 diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb new file mode 100644 index 0000000..d59e446 --- /dev/null +++ b/test/controllers/sessions_controller_test.rb @@ -0,0 +1,19 @@ +require 'test_helper' + +class SessionsControllerTest < ActionController::TestCase + # test "should get new" do + # get :new + # assert_response :success + # end + + # test "should get create" do + # get :create + # assert_response :success + # end + # + # test "should get destroy" do + # delete :destroy + # assert_response :redirect + # end + +end diff --git a/test/controllers/suggestions_controller_test.rb b/test/controllers/suggestions_controller_test.rb new file mode 100644 index 0000000..df950e2 --- /dev/null +++ b/test/controllers/suggestions_controller_test.rb @@ -0,0 +1,24 @@ +require 'test_helper' + +class SuggestionsControllerTest < ActionController::TestCase + test "should get index" do + get(:index, { 'uid' => 'americandreamers' }) + assert_not_nil + end + + # test "should get favorite" do + # post :favorite + # assert_response :success + # end + # + # test "should get favorites" do + # get :favorites + # assert_response :success + # end + # + # test "should get unfavorite" do + # delete :unfavorite + # assert_response :redirect + #end + +end diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 0000000..9dcef0a --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,13 @@ +# 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 +# +known_user: + uid: americandreamers + provider: spotify + # open_spotify_url: https://open.spotify.com/user/americandreamers diff --git a/test/models/food_test.rb b/test/models/food_test.rb new file mode 100644 index 0000000..d37afdc --- /dev/null +++ b/test/models/food_test.rb @@ -0,0 +1,63 @@ +require 'test_helper' + +class FoodTest < ActiveSupport::TestCase + describe "Food" do + before do + @intance_of_food = Food.find_in_api("seattle-yoga-lounge-seattle") + end + + it "knows that it has an image url", :vcr do + assert_instance_of String, @intance_of_food.the_image_url + end + + it "knows its name", :vcr do + assert_equal "Seattle Yoga Lounge", @intance_of_food.name + end + + it "knows its rating", :vcr do + assert_equal 3.5, @intance_of_food.rating + assert_instance_of Fixnum, @intance_of_food.review_count + end + + it "knows its review_count", :vcr do + assert_equal 92, @intance_of_food.review_count + assert_instance_of Fixnum, @intance_of_food.review_count + end + + it "knows its rating_img_url_large", :vcr do + assert_instance_of String, @intance_of_food.rating_img_url_large + end + + it "knows its categories", :vcr do + assert_instance_of Array, @intance_of_food.categories + end + + it "knows its location", :vcr do + assert_instance_of Array, @intance_of_food.location + end + + it "knows its display_phone", :vcr do + assert_equal "+1-206-523-4569", @intance_of_food.display_phone + assert_instance_of String, @intance_of_food.display_phone + end + + it "knows that it has an open in Yelp url", :vcr do + assert_instance_of String, @intance_of_food.open_yelp_url + end + end + + # describe "invalid Food" do + # before do + # @invalid_intance_of_food = Food.find_in_api("melissa-jimison") + # end + # + # it "knows its display_phone", :vcr do + # assert_equal "+1-206-523-4569", @invalid_intance_of_food.display_phone + # assert_instance_of String, @invalid_intance_of_food.display_phone + # end + # + # it "knows that it has an open in Yelp url", :vcr do + # assert_instance_of String, @invalid_intance_of_food.open_yelp_url + # end + # end +end diff --git a/test/models/music_test.rb b/test/models/music_test.rb new file mode 100644 index 0000000..3b44df9 --- /dev/null +++ b/test/models/music_test.rb @@ -0,0 +1,72 @@ +require 'test_helper' + +class MusicTest < ActiveSupport::TestCase + # describe Music do + # it "uses v2 of the API" do + # assert_equal "http://pokeapi.co/api/v2/", Music::BASE_URL + # end + + describe "artist" do + before do + @intance_of_music = Music.create("artist","1jn4AT2jGKmlUVZWmuzNP4") + end + it "knows its name", :vcr do + assert_equal "Ricky Taco", @intance_of_music.name + end + + it "knows its type", :vcr do + assert_equal "artist", @intance_of_music.type + end + + it "knows that it has an image url", :vcr do + assert_instance_of String, @intance_of_music.image + end + + it "knows that it has an open in spotify url", :vcr do + assert_instance_of String, @intance_of_music.open_spotify_url + end + end + + describe "album" do + before do + @intance_of_music = Music.create("album","1Frb2yxLXQSaMzqnfCB1Dx") + end + it "knows its name", :vcr do + assert_equal "In the Style of Shakira - Vol. 2 (Karaoke - Professional Performance Tracks)", @intance_of_music.name + end + + it "knows its type", :vcr do + assert_equal "album", @intance_of_music.type + end + + it "knows that it has an image url", :vcr do + assert_instance_of String, @intance_of_music.image + end + + it "knows that it has an open in spotify url", :vcr do + assert_instance_of String, @intance_of_music.open_spotify_url + end + end + + describe "track" do + before do + @intance_of_music = Music.create("track","0FC7X3BRdEJC8L4ZEUAv2Q") + end + it "knows its name", :vcr do + assert_equal "Born This Way", @intance_of_music.name + end + + it "knows its type", :vcr do + assert_equal "track", @intance_of_music.type + end + + it "knows that it has an image url", :vcr do + assert_instance_of String, @intance_of_music.image + end + + it "knows that it has an open in spotify url", :vcr do + assert_instance_of String, @intance_of_music.open_spotify_url + end + end + +end diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000..c0b20fc --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,33 @@ +require 'test_helper' + +class UserTest < ActiveSupport::TestCase + def setup + #@known = OmniAuth.config.mock_auth[:spotify_known] + @known = { "info" => { "id" => "americandreamers" }, "provider" => 'spotify' } + @unknown = OmniAuth.config.mock_auth[:spotify_unknown] + @unknown_with_uid = OmniAuth.config.mock_auth[:spotify_uid] + 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 "uses oauth data to set user name, provider and 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 + # + # 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 92e39b2..1f90427 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,10 +1,37 @@ +require 'simplecov' +SimpleCov.start do + add_filter "/test/" + add_filter "/app/helpers/" + add_filter "/config/environment.rb" + add_filter "/config/environments/" + +end + ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' +require 'minitest/spec' +require "minispec-metadata" +require 'vcr' +require 'minitest-vcr' +require 'webmock/minitest' +require "minitest/reporters" + +VCR.configure do |c| + c.cassette_library_dir = 'test/cassettes' + c.hook_into :webmock +end + +Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new +MinitestVcr::Spec.configure! + +OmniAuth.config.test_mode = true +# OmniAuth.config.mock_auth[:spotify] = {:provider => 'spotify', :uid => 'americandreamers'} 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... + end