+
+
+ <%= link_to(image_tag(@result.image, class: 'recipe-image'), image_path(@result.url)) %>
+
+
+
+
+
<%= link_to @result.label, @result.url %>
+
+
Ingredients
+
+ <% @result.ingredients.each do |ingredient| %>
+ - <%= round_to(ingredient['quantity'], 0) %> <%= ingredient['measure'] %> <%= ingredient['food'].titleize %>
+ <% end %>
+
+
+
+
+
Nutritional Information
+
+ <% @result.totalDaily.each do |key, value| %>
+ -
+ <% value.each do |k, v| %>
+ <%= round_to(v, 0) %>
+ <% end %>
+ <% end %>
+
+
+ <%= link_to "Back", :back, class: 'button' %>
+
+
+
+
\ No newline at end of file
diff --git a/app/views/recipes/update.html.erb b/app/views/recipes/update.html.erb
new file mode 100644
index 000000000..6243b5d1b
--- /dev/null
+++ b/app/views/recipes/update.html.erb
@@ -0,0 +1,2 @@
+
Recipes#update
+
Find me in app/views/recipes/update.html.erb
diff --git a/app/views/sessions/create.html.erb b/app/views/sessions/create.html.erb
new file mode 100644
index 000000000..c251174fe
--- /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 000000000..d75237d98
--- /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 000000000..b39a3bc95
--- /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/users/create.html.erb b/app/views/users/create.html.erb
new file mode 100644
index 000000000..48ea02e60
--- /dev/null
+++ b/app/views/users/create.html.erb
@@ -0,0 +1,2 @@
+
Users#create
+
Find me in app/views/users/create.html.erb
diff --git a/app/views/users/destroy.html.erb b/app/views/users/destroy.html.erb
new file mode 100644
index 000000000..de4bd2634
--- /dev/null
+++ b/app/views/users/destroy.html.erb
@@ -0,0 +1,2 @@
+
Users#destroy
+
Find me in app/views/users/destroy.html.erb
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb
new file mode 100644
index 000000000..1881fbdba
--- /dev/null
+++ b/app/views/users/edit.html.erb
@@ -0,0 +1,2 @@
+
Users#edit
+
Find me in app/views/users/edit.html.erb
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
new file mode 100644
index 000000000..51968c88d
--- /dev/null
+++ b/app/views/users/index.html.erb
@@ -0,0 +1,2 @@
+
Users#index
+
Find me in app/views/users/index.html.erb
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb
new file mode 100644
index 000000000..c21a1adf1
--- /dev/null
+++ b/app/views/users/new.html.erb
@@ -0,0 +1,2 @@
+
Users#new
+
Find me in app/views/users/new.html.erb
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
new file mode 100644
index 000000000..e5fa3adf1
--- /dev/null
+++ b/app/views/users/show.html.erb
@@ -0,0 +1,2 @@
+
Users#show
+
Find me in app/views/users/show.html.erb
diff --git a/app/views/users/update.html.erb b/app/views/users/update.html.erb
new file mode 100644
index 000000000..cabbde176
--- /dev/null
+++ b/app/views/users/update.html.erb
@@ -0,0 +1,2 @@
+
Users#update
+
Find me in app/views/users/update.html.erb
diff --git a/bin/bundle b/bin/bundle
new file mode 100755
index 000000000..66e9889e8
--- /dev/null
+++ b/bin/bundle
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+load Gem.bin_path('bundler', 'bundle')
diff --git a/bin/rails b/bin/rails
new file mode 100755
index 000000000..0138d79b7
--- /dev/null
+++ b/bin/rails
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path('../spring', __FILE__)
+rescue LoadError => e
+ raise unless e.message.include?('spring')
+end
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require_relative '../config/boot'
+require 'rails/commands'
diff --git a/bin/rake b/bin/rake
new file mode 100755
index 000000000..d87d5f578
--- /dev/null
+++ b/bin/rake
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path('../spring', __FILE__)
+rescue LoadError => e
+ raise unless e.message.include?('spring')
+end
+require_relative '../config/boot'
+require 'rake'
+Rake.application.run
diff --git a/bin/setup b/bin/setup
new file mode 100755
index 000000000..acdb2c138
--- /dev/null
+++ b/bin/setup
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+require 'pathname'
+
+# path to your application root.
+APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
+
+Dir.chdir APP_ROOT do
+ # This script is a starting point to setup your application.
+ # Add necessary setup steps to this file:
+
+ puts "== Installing dependencies =="
+ system "gem install bundler --conservative"
+ system "bundle check || bundle install"
+
+ # puts "\n== Copying sample files =="
+ # unless File.exist?("config/database.yml")
+ # system "cp config/database.yml.sample config/database.yml"
+ # end
+
+ puts "\n== Preparing database =="
+ system "bin/rake db:setup"
+
+ puts "\n== Removing old logs and tempfiles =="
+ system "rm -f log/*"
+ system "rm -rf tmp/cache"
+
+ puts "\n== Restarting application server =="
+ system "touch tmp/restart.txt"
+end
diff --git a/bin/spring b/bin/spring
new file mode 100755
index 000000000..9bc076b9e
--- /dev/null
+++ b/bin/spring
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+
+# This file loads spring without using Bundler, in order to be fast.
+# It gets overwritten when you run the `spring binstub` command.
+
+unless defined?(Spring)
+ require 'rubygems'
+ require 'bundler'
+
+ lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
+ if spring = lockfile.specs.detect { |spec| spec.name == "spring" }
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
+ gem 'spring', spring.version
+ require 'spring/binstub'
+ end
+end
diff --git a/config.ru b/config.ru
new file mode 100644
index 000000000..bd83b2541
--- /dev/null
+++ b/config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Rails.application
diff --git a/config/application.rb b/config/application.rb
new file mode 100644
index 000000000..4ecc7a04a
--- /dev/null
+++ b/config/application.rb
@@ -0,0 +1,27 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+# Require the gems listed in Gemfile, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(*Rails.groups)
+
+module ApiMuncher
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # Do not swallow errors in after_commit/after_rollback callbacks.
+ config.active_record.raise_in_transactional_callbacks = true
+ config.autoload_paths << Rails.root.join('lib')
+ end
+end
diff --git a/config/boot.rb b/config/boot.rb
new file mode 100644
index 000000000..6b750f00b
--- /dev/null
+++ b/config/boot.rb
@@ -0,0 +1,3 @@
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' # Set up gems listed in the Gemfile.
diff --git a/config/database.yml b/config/database.yml
new file mode 100644
index 000000000..1c1a37ca8
--- /dev/null
+++ b/config/database.yml
@@ -0,0 +1,25 @@
+# SQLite version 3.x
+# gem install sqlite3
+#
+# Ensure the SQLite 3 gem is defined in your Gemfile
+# gem 'sqlite3'
+#
+default: &default
+ adapter: sqlite3
+ pool: 5
+ timeout: 5000
+
+development:
+ <<: *default
+ database: db/development.sqlite3
+
+# 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: db/test.sqlite3
+
+production:
+ <<: *default
+ database: db/production.sqlite3
diff --git a/config/environment.rb b/config/environment.rb
new file mode 100644
index 000000000..ee8d90dc6
--- /dev/null
+++ b/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the Rails application.
+require File.expand_path('../application', __FILE__)
+
+# Initialize the Rails application.
+Rails.application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
new file mode 100644
index 000000000..b55e2144b
--- /dev/null
+++ b/config/environments/development.rb
@@ -0,0 +1,41 @@
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
+ config.cache_classes = false
+
+ # Do not eager load code on boot.
+ config.eager_load = false
+
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Don't care if the mailer can't send.
+ config.action_mailer.raise_delivery_errors = false
+
+ # Print deprecation notices to the Rails logger.
+ config.active_support.deprecation = :log
+
+ # Raise an error on page load if there are pending migrations.
+ config.active_record.migration_error = :page_load
+
+ # Debug mode disables concatenation and preprocessing of assets.
+ # This option may cause significant delays in view rendering with a large
+ # number of complex assets.
+ config.assets.debug = true
+
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
+ # yet still be able to expire them through the digest params.
+ config.assets.digest = true
+
+ # Adds additional error checking when serving assets at runtime.
+ # Checks for improperly declared sprockets dependencies.
+ # Raises helpful error messages.
+ config.assets.raise_runtime_errors = true
+
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
+end
diff --git a/config/environments/production.rb b/config/environments/production.rb
new file mode 100644
index 000000000..5c1b32e48
--- /dev/null
+++ b/config/environments/production.rb
@@ -0,0 +1,79 @@
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # Code is not reloaded between requests.
+ config.cache_classes = true
+
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both threaded web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
+ config.eager_load = true
+
+ # Full error reports are disabled and caching is turned on.
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
+ # Add `rack-cache` to your Gemfile before enabling this.
+ # For large-scale production use, consider using a caching reverse proxy like
+ # NGINX, varnish or squid.
+ # config.action_dispatch.rack_cache = true
+
+ # Disable serving static files from the `/public` folder by default since
+ # Apache or NGINX already handles this.
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
+
+ # Compress JavaScripts and CSS.
+ config.assets.js_compressor = :uglifier
+ # config.assets.css_compressor = :sass
+
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
+ config.assets.compile = false
+
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
+ # yet still be able to expire them through the digest params.
+ config.assets.digest = true
+
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
+
+ # Specifies the header that your server uses for sending files.
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # Use the lowest log level to ensure availability of diagnostic information
+ # when problems arise.
+ config.log_level = :debug
+
+ # Prepend all log lines with the following tags.
+ # config.log_tags = [ :subdomain, :uuid ]
+
+ # Use a different logger for distributed setups.
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
+
+ # Use a different cache store in production.
+ # config.cache_store = :mem_cache_store
+
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
+ # config.action_controller.asset_host = 'http://assets.example.com'
+
+ # Ignore bad email addresses and do not raise email delivery errors.
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation cannot be found).
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners.
+ config.active_support.deprecation = :notify
+
+ # Use default logging formatter so that PID and timestamp are not suppressed.
+ config.log_formatter = ::Logger::Formatter.new
+
+ # Do not dump schema after migrations.
+ config.active_record.dump_schema_after_migration = false
+end
diff --git a/config/environments/test.rb b/config/environments/test.rb
new file mode 100644
index 000000000..1c19f08b2
--- /dev/null
+++ b/config/environments/test.rb
@@ -0,0 +1,42 @@
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
+
+ # The test environment is used exclusively to run your application's
+ # test suite. You never need to work with it otherwise. Remember that
+ # your test database is "scratch space" for the test suite and is wiped
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+
+ # Do not eager load code on boot. This avoids loading your whole application
+ # just for the purpose of running a single test. If you are using a tool that
+ # preloads Rails for running tests, you may have to set it to true.
+ config.eager_load = false
+
+ # Configure static file server for tests with Cache-Control for performance.
+ config.serve_static_files = true
+ config.static_cache_control = 'public, max-age=3600'
+
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Raise exceptions instead of rendering exception templates.
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment.
+ config.action_controller.allow_forgery_protection = false
+
+ # Tell Action Mailer not to deliver emails to the real world.
+ # The :test delivery method accumulates sent emails in the
+ # ActionMailer::Base.deliveries array.
+ config.action_mailer.delivery_method = :test
+
+ # Randomize the order test cases are executed.
+ config.active_support.test_order = :random
+
+ # Print deprecation notices to the stderr.
+ config.active_support.deprecation = :stderr
+
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
+end
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
new file mode 100644
index 000000000..01ef3e663
--- /dev/null
+++ b/config/initializers/assets.rb
@@ -0,0 +1,11 @@
+# Be sure to restart your server when you modify this file.
+
+# Version of your assets, change this if you want to expire all your assets.
+Rails.application.config.assets.version = '1.0'
+
+# Add additional assets to the asset load path
+# Rails.application.config.assets.paths << Emoji.images_path
+
+# Precompile additional assets.
+# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+# Rails.application.config.assets.precompile += %w( search.js )
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
new file mode 100644
index 000000000..59385cdf3
--- /dev/null
+++ b/config/initializers/backtrace_silencers.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
+
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb
new file mode 100644
index 000000000..7f70458de
--- /dev/null
+++ b/config/initializers/cookies_serializer.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.action_dispatch.cookies_serializer = :json
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
new file mode 100644
index 000000000..4a994e1e7
--- /dev/null
+++ b/config/initializers/filter_parameter_logging.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure sensitive parameters which will be filtered from the log file.
+Rails.application.config.filter_parameters += [:password]
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
new file mode 100644
index 000000000..ac033bf9d
--- /dev/null
+++ b/config/initializers/inflections.rb
@@ -0,0 +1,16 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
+
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.acronym 'RESTful'
+# end
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
new file mode 100644
index 000000000..dc1899682
--- /dev/null
+++ b/config/initializers/mime_types.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
new file mode 100644
index 000000000..05c9ef6ac
--- /dev/null
+++ b/config/initializers/omniauth.rb
@@ -0,0 +1,8 @@
+#omniauth.rb
+
+Rails.application.config.middleware.use OmniAuth::Builder do
+ # binding.pry
+ provider :github, ENV["GITHUB_CLIENT_ID"], ENV["GITHUB_CLIENT_SECRET"], scope: "user:email"
+
+ provider :google_oauth2, ENV["GOOGLE_CLIENT_ID"], ENV["GOOGLE_CLIENT_SECRET"]
+end
\ No newline at end of file
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
new file mode 100644
index 000000000..6cc0e03e4
--- /dev/null
+++ b/config/initializers/session_store.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.session_store :cookie_store, key: '_api-muncher_session'
diff --git a/config/initializers/will_paginate.rb b/config/initializers/will_paginate.rb
new file mode 100644
index 000000000..04dbff8b3
--- /dev/null
+++ b/config/initializers/will_paginate.rb
@@ -0,0 +1,3 @@
+#will_paginate.rb
+
+require 'will_paginate/array'
\ No newline at end of file
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
new file mode 100644
index 000000000..33725e95f
--- /dev/null
+++ b/config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
+end
+
+# To enable root element in JSON for ActiveRecord objects.
+# ActiveSupport.on_load(:active_record) do
+# self.include_root_in_json = true
+# end
diff --git a/config/locales/en.yml b/config/locales/en.yml
new file mode 100644
index 000000000..065395716
--- /dev/null
+++ b/config/locales/en.yml
@@ -0,0 +1,23 @@
+# Files in the config/locales directory are used for internationalization
+# and are automatically loaded by Rails. If you want to use locales other
+# than English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+# I18n.t 'hello'
+#
+# In views, this is aliased to just `t`:
+#
+# <%= t('hello') %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+# I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# To learn more, please read the Rails Internationalization guide
+# available at http://guides.rubyonrails.org/i18n.html.
+
+en:
+ hello: "Hello world"
diff --git a/config/routes.rb b/config/routes.rb
new file mode 100644
index 000000000..7e1eaff72
--- /dev/null
+++ b/config/routes.rb
@@ -0,0 +1,103 @@
+Rails.application.routes.draw do
+
+root 'recipes#index'
+
+ #******** RECIPES ROUTES *********
+
+ get 'recipes/search' => 'recipes#search', as: 'recipes_search'
+
+ get 'recipes' => 'recipes#index', as: 'recipes_index'
+
+ get 'recipes/show/:id' => 'recipes#show', as: 'recipes_show'
+
+ get 'recipes/new'
+
+ get 'recipes/create'
+
+ get 'recipes/edit'
+
+ get 'recipes/update'
+
+ get 'recipes/destroy'
+
+ #******** USERS ROUTES *********
+
+
+ get 'users/index' => 'users#index'
+
+ get 'users/show' => 'users#show'
+
+ get 'users/new' => 'users#new'
+
+ post 'users/create' => 'users#create'
+
+ get 'users/edit' => 'users#edit'
+
+ put 'users/update' => 'users#update'
+
+ delete 'users/destroy' => 'users#destroy'
+
+#SESSIONS ROUTES
+
+ resources :sessions
+
+
+ get "/auth/:provider/callback" => 'sessions#create'
+
+ get 'logout' => 'sessions#destroy'
+
+ # The priority is based upon order of creation: first created -> highest priority.
+ # See how all your routes lay out with "rake routes".
+
+ # You can have the root of your site routed with "root"
+ # root 'welcome#index'
+
+ # Example of regular route:
+ # get 'products/:id' => 'catalog#view'
+
+ # Example of named route that can be invoked with purchase_url(id: product.id)
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
+
+ # Example resource route (maps HTTP verbs to controller actions automatically):
+ # resources :products
+
+ # Example resource route with options:
+ # resources :products do
+ # member do
+ # get 'short'
+ # post 'toggle'
+ # end
+ #
+ # collection do
+ # get 'sold'
+ # end
+ # end
+
+ # Example resource route with sub-resources:
+ # resources :products do
+ # resources :comments, :sales
+ # resource :seller
+ # end
+
+ # Example resource route with more complex sub-resources:
+ # resources :products do
+ # resources :comments
+ # resources :sales do
+ # get 'recent', on: :collection
+ # end
+ # end
+
+ # Example resource route with concerns:
+ # concern :toggleable do
+ # post 'toggle'
+ # end
+ # resources :posts, concerns: :toggleable
+ # resources :photos, concerns: :toggleable
+
+ # Example resource route within a namespace:
+ # namespace :admin do
+ # # Directs /admin/products/* to Admin::ProductsController
+ # # (app/controllers/admin/products_controller.rb)
+ # resources :products
+ # end
+end
diff --git a/config/secrets.yml b/config/secrets.yml
new file mode 100644
index 000000000..a6646551e
--- /dev/null
+++ b/config/secrets.yml
@@ -0,0 +1,22 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key is used for verifying the integrity of signed cookies.
+# If you change this key, all old signed cookies will become invalid!
+
+# Make sure the secret is at least 30 characters and all random,
+# no regular words or you'll be exposed to dictionary attacks.
+# You can use `rake secret` to generate a secure secret key.
+
+# Make sure the secrets in this file are kept private
+# if you're sharing your code publicly.
+
+development:
+ secret_key_base: ba85a1497c3b4b724585bfe0a33ecadfad9ca1df6bb2930df54cb08153358f4f7b760525ff5e656858d4b548b3a36da7061ae24521decc93096408f820371eb9
+
+test:
+ secret_key_base: e77f843b38ffcaa42f8466e372691a1c526740540402831ba99f5c616750e661e3bf75053d745acbb3c554025b639b7aebaf1765d82295840d7ee50692af89ce
+
+# Do not keep production secrets in the repository,
+# instead read values from the environment.
+production:
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
diff --git a/db/migrate/20161101041904_create_users.rb b/db/migrate/20161101041904_create_users.rb
new file mode 100644
index 000000000..03212bfaa
--- /dev/null
+++ b/db/migrate/20161101041904_create_users.rb
@@ -0,0 +1,10 @@
+class CreateUsers < ActiveRecord::Migration
+ def change
+ create_table :users do |t|
+ t.string :name
+ t.string :email
+
+ t.timestamps null: false
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
new file mode 100644
index 000000000..534c1bcfb
--- /dev/null
+++ b/db/schema.rb
@@ -0,0 +1,23 @@
+# 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: 20161101041904) do
+
+ create_table "users", force: :cascade do |t|
+ t.string "name"
+ t.string "email"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+end
diff --git a/db/seeds.rb b/db/seeds.rb
new file mode 100644
index 000000000..4edb1e857
--- /dev/null
+++ b/db/seeds.rb
@@ -0,0 +1,7 @@
+# This file should contain all the record creation needed to seed the database with its default values.
+# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
+#
+# Examples:
+#
+# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
+# Mayor.create(name: 'Emanuel', city: cities.first)
diff --git a/lib/assets/.keep b/lib/assets/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/lib/recipe_result.rb b/lib/recipe_result.rb
new file mode 100644
index 000000000..bd6da4068
--- /dev/null
+++ b/lib/recipe_result.rb
@@ -0,0 +1,66 @@
+#recipe_result.rb
+
+#NOTE dietlabels, health labels, cautions, ingredientlines, ingredients, totalNutrients, totalDaily show up as arrays (ingredients is an array of hashes)
+
+# require_relative 'recipe_search_wrapper'
+
+class RecipeResult
+ attr_reader :uri, :label, :image, :url, :shareas, :ingredients, :calories, :totalNutrients, :totalDaily
+ # def initialize(uri, label, image, url)
+ def initialize(recipe_details)
+
+ @label = recipe_details['label']
+
+
+ @uri = ""
+ real_uri = false
+
+ recipe_details['uri'].each_char do |character|
+ if character == "_"
+ real_uri = true
+ end
+
+ if real_uri
+ @uri << character
+ end
+ end
+
+ if @uri == nil || @uri == "" || @label == nil || @label == ""
+ raise ArgumentError
+ end
+
+ @image = recipe_details['image']
+ @url = recipe_details['url']
+ @shareas = recipe_details['shareas'] #link to the recipe on edamam website, as opposed to the source website
+ @ingredients = recipe_details['ingredients']
+ @calories = recipe_details['calories']
+ @totalNutrients = recipe_details['totalNutrients']
+ @totalDaily = recipe_details['totalDaily']
+ end
+
+
+end
+
+
+
+
+
+
+ # @uri = uri #aka id
+ # @label = label
+ # @image = params["image"]
+ # # @source = recipe["source"]
+ # # @sourceicon = recipe["sourceicon"] #
+ # # @url = recipe["url"] #link to recipe on source website
+ # @shareas = params["shareas"] #link to the recipe on edamam website, as opposed to the source website
+ # # @recipe_yield = recipe["recipe_yield"]
+ # # @dietabels = recipe["dietLabels"]
+ # # @healthabels = recipe["healthlabels"]
+ # # @cautions = recipe["cautions"]
+ # # @ingredientines = recipe["ingredientlines"]
+ # # @ingredients = recipe["ingredients"]
+ # # @calories = recipe["calories"]
+ # # @totalweight = recipe["totalweight"]
+ # # @totalnutrients = recipe["totalnutrients"]
+ # # @totaldaily = recipe["totaldaily"]
+ # end
\ No newline at end of file
diff --git a/lib/recipe_search_wrapper.rb b/lib/recipe_search_wrapper.rb
new file mode 100644
index 000000000..41a113c94
--- /dev/null
+++ b/lib/recipe_search_wrapper.rb
@@ -0,0 +1,84 @@
+#recipe_search_wrapper.rb
+
+require 'dotenv'
+Dotenv.load!
+require 'httparty'
+require_relative 'recipe_result'
+require_relative 'sample-recipe-result'
+
+class RecipeSearchWrapper
+ attr_reader :uri, :label, :image, :shareas, :url, :ingredients, :calories, :totalNutrients
+
+
+
+#CONSTANTS
+#hide that information away!
+ APP_ID = ENV["APP_ID"]
+ APP_KEY = ENV["APP_KEY"]
+
+ BASE_URL = "https://api.edamam.com/search?"
+
+# /CONSTANTS
+
+
+
+
+#CREATE A WRAPPER
+ def initialize(uri)
+ @uri = uri #aka id
+ end
+
+
+
+#helps users find recipes by an ingredient
+
+#changed to 100 for will_paginate
+ def self.search_by_one_keyword(keyword, list_start = 0, list_end = 100, my_app_id = nil, my_app_key = nil )
+ my_app_id ||= APP_ID
+ my_app_key ||= APP_KEY
+
+ url = BASE_URL + "q=#{keyword}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}" + "&from=#{list_start}" + "&to=#{list_end}"
+
+#THIS IS WHERE THE MAGIC HAPPENS, MY JSON HASH
+ data = HTTParty.get(url)
+
+ recipes = []
+
+ if data["hits"]
+
+ results_array = data["hits"]
+
+ results_array.each do |result|
+
+ wrapper = RecipeResult.new(result["recipe"])
+
+ recipes << wrapper
+
+ end
+
+ return recipes
+
+ else
+
+ return nil
+
+ end
+ end
+
+ def self.show_just_one_recipe(recipe_uri)
+ my_app_id ||= APP_ID
+ my_app_key ||= APP_KEY
+
+ url = BASE_URL + "r=http://www.edamam.com/ontologies/edamam.owl%23recipe#{recipe_uri}" + "&app_id=#{my_app_id}" + "&app_key=#{my_app_key}"
+ #THIS IS WHERE THE MAGIC HAPPENS, MY JSON HASH
+ data = HTTParty.get(url)
+
+
+ recipe = RecipeResult.new(data.first)
+
+ return recipe
+
+
+ end
+end
+
diff --git a/lib/sample-recipe-result.rb b/lib/sample-recipe-result.rb
new file mode 100644
index 000000000..5e81fa870
--- /dev/null
+++ b/lib/sample-recipe-result.rb
@@ -0,0 +1,1268 @@
+class Sample
+ SAMPLE_RECIPE = {
+ "q": "carrot",
+ "from": 0,
+ "to": 10,
+ "params": {
+ "sane": [],
+ "q": [
+ "carrot"
+ ],
+ "app_id": [
+ "d24a2641"
+ ],
+ "app_key": [
+ "178d4d3e2f7d0a953b4b0b40f2243762"
+ ]
+ },
+ "more": true,
+ "count": 1000,
+ "hits": [
+ {
+ "recipe": {
+ "uri": "http://www.edamam.com/ontologies/edamam.owl#recipe_be5a134c776c528ff22c664552ccb69a",
+ "label": "Carrots Braised in Beer and Carrot Juice",
+ "image": "https://www.edamam.com/web-img/6d7/6d7c318d7a0e0b11413bbf5c4cc91583.jpg",
+ "source": "Food & Wine",
+ "sourceIcon": "http://www.foodandwine.com/favicon.ico",
+ "url": "http://www.foodandwine.com/recipes/carrots-braised-in-beer-and-carrot-juice",
+ "shareAs": "http://www.edamam.com/recipe/carrots-braised-in-beer-and-carrot-juice-be5a134c776c528ff22c664552ccb69a/carrot",
+ "yield": 4,
+ "dietLabels": [
+ "Low-Sodium"
+ ],
+ "healthLabels": [
+ "Vegetarian",
+ "Egg-Free",
+ "Peanut-Free",
+ "Tree-Nut-Free",
+ "Soy-Free",
+ "Fish-Free",
+ "Shellfish-Free"
+ ],
+ "cautions": [],
+ "ingredientLines": [
+ "8 medium carrots",
+ "1 cup fresh carrot juice",
+ "1/2 cup hoppy beer, such as a pilsner",
+ "1 teaspoon sugar",
+ "1 tablespoon unsalted butter",
+ "Salt"
+ ],
+ "ingredients": [
+ {
+ "text": "8 medium carrots",
+ "quantity": 8,
+ "measure": "medium",
+ "food": "carrots",
+ "weight": 488
+ },
+ {
+ "text": "1 cup fresh carrot juice",
+ "quantity": 1,
+ "measure": "cup",
+ "food": "carrot juice",
+ "weight": 236
+ },
+ {
+ "text": "1/2 cup hoppy beer, such as a pilsner",
+ "quantity": 0.5,
+ "measure": "cup",
+ "food": "beer",
+ "weight": 94.93002
+ },
+ {
+ "text": "1 teaspoon sugar",
+ "quantity": 1,
+ "measure": "tsp",
+ "food": "sugar",
+ "weight": 4.2
+ },
+ {
+ "text": "1 tablespoon unsalted butter",
+ "quantity": 1,
+ "measure": "tbsp",
+ "food": "unsalted butter",
+ "weight": 14.2
+ },
+ {
+ "text": "Salt",
+ "quantity": 0,
+ "measure": "medium",
+ "food": "salt",
+ "weight": 0.029010605938335318
+ }
+ ],
+ "calories": 453.36790859999996,
+ "totalWeight": 837.3590306059384,
+ "totalNutrients": {
+ "ENERC_KCAL": {
+ "label": "Energy",
+ "quantity": 453.36790859999996,
+ "unit": "kcal"
+ },
+ "FAT": {
+ "label": "Fat",
+ "quantity": 13.042819999999999,
+ "unit": "g"
+ },
+ "FASAT": {
+ "label": "Saturated",
+ "quantity": 7.486719999999999,
+ "unit": "g"
+ },
+ "FATRN": {
+ "label": "Trans",
+ "quantity": 0.46434,
+ "unit": "g"
+ },
+ "FAMS": {
+ "label": "Monounsaturated",
+ "quantity": 3.0501599999999995,
+ "unit": "g"
+ },
+ "FAPU": {
+ "label": "Polyunsaturated",
+ "quantity": 1.13368,
+ "unit": "g"
+ },
+ "CHOCDF": {
+ "label": "Carbs",
+ "quantity": 76.22889571,
+ "unit": "g"
+ },
+ "FIBTG": {
+ "label": "Fiber",
+ "quantity": 15.552,
+ "unit": "g"
+ },
+ "SUGAR": {
+ "label": "Sugars",
+ "quantity": 36.55892,
+ "unit": "g"
+ },
+ "PROCNT": {
+ "label": "Protein",
+ "quantity": 7.337778092000001,
+ "unit": "g"
+ },
+ "CHOLE": {
+ "label": "Cholesterol",
+ "quantity": 30.529999999999998,
+ "unit": "mg"
+ },
+ "NA": {
+ "label": "Sodium",
+ "quantity": 509.12513144957995,
+ "unit": "mg"
+ },
+ "CA": {
+ "label": "Calcium",
+ "quantity": 224.93416334542522,
+ "unit": "mg"
+ },
+ "MG": {
+ "label": "Magnesium",
+ "quantity": 97.58009130605939,
+ "unit": "mg"
+ },
+ "K": {
+ "label": "Potassium",
+ "quantity": 2279.8454262484743,
+ "unit": "mg"
+ },
+ "FE": {
+ "label": "Iron",
+ "quantity": 2.5736217389995963,
+ "unit": "mg"
+ },
+ "ZN": {
+ "label": "Zinc",
+ "quantity": 1.6187220126059385,
+ "unit": "mg"
+ },
+ "P": {
+ "label": "Phosphorus",
+ "quantity": 286.61820279999995,
+ "unit": "mg"
+ },
+ "VITA_RAE": {
+ "label": "Vitamin A",
+ "quantity": 6428.087999999999,
+ "unit": "µg_RAE"
+ },
+ "VITC": {
+ "label": "Vitamin C",
+ "quantity": 48.852000000000004,
+ "unit": "mg"
+ },
+ "THIA": {
+ "label": "Thiamin (B1)",
+ "quantity": 0.5106565009999999,
+ "unit": "mg"
+ },
+ "RIBF": {
+ "label": "Riboflavin (B2)",
+ "quantity": 0.38566600399999995,
+ "unit": "mg"
+ },
+ "NIA": {
+ "label": "Niacin (B3)",
+ "quantity": 6.169023102,
+ "unit": "mg"
+ },
+ "VITB6A": {
+ "label": "Vitamin B6",
+ "quantity": 1.168398008,
+ "unit": "mg"
+ },
+ "FOL": {
+ "label": "Folic Acid (B9)",
+ "quantity": 108.2818012,
+ "unit": "µg"
+ },
+ "VITB12": {
+ "label": "Vitamin B12",
+ "quantity": 0.043126003999999996,
+ "unit": "µg"
+ },
+ "VITD": {
+ "label": "Vitamin D",
+ "quantity": 0.21299999999999997,
+ "unit": "µg"
+ },
+ "TOCPHA": {
+ "label": "Vitamin E",
+ "quantity": 6.287839999999999,
+ "unit": "mg"
+ },
+ "VITK1": {
+ "label": "Vitamin K",
+ "quantity": 101.99,
+ "unit": "µg"
+ }
+ },
+ "totalDaily": {
+ "ENERC_KCAL": {
+ "label": "Energy",
+ "quantity": 22.668395429999997,
+ "unit": "%"
+ },
+ "FAT": {
+ "label": "Fat",
+ "quantity": 20.06587692307692,
+ "unit": "%"
+ },
+ "FASAT": {
+ "label": "Saturated",
+ "quantity": 37.4336,
+ "unit": "%"
+ },
+ "CHOCDF": {
+ "label": "Carbs",
+ "quantity": 25.409631903333334,
+ "unit": "%"
+ },
+ "FIBTG": {
+ "label": "Fiber",
+ "quantity": 62.208,
+ "unit": "%"
+ },
+ "PROCNT": {
+ "label": "Protein",
+ "quantity": 14.675556184000001,
+ "unit": "%"
+ },
+ "CHOLE": {
+ "label": "Cholesterol",
+ "quantity": 10.176666666666666,
+ "unit": "%"
+ },
+ "NA": {
+ "label": "Sodium",
+ "quantity": 21.213547143732498,
+ "unit": "%"
+ },
+ "CA": {
+ "label": "Calcium",
+ "quantity": 22.493416334542523,
+ "unit": "%"
+ },
+ "MG": {
+ "label": "Magnesium",
+ "quantity": 24.395022826514847,
+ "unit": "%"
+ },
+ "K": {
+ "label": "Potassium",
+ "quantity": 65.13844074995642,
+ "unit": "%"
+ },
+ "FE": {
+ "label": "Iron",
+ "quantity": 14.29789854999776,
+ "unit": "%"
+ },
+ "ZN": {
+ "label": "Zinc",
+ "quantity": 10.79148008403959,
+ "unit": "%"
+ },
+ "P": {
+ "label": "Phosphorus",
+ "quantity": 40.945457542857135,
+ "unit": "%"
+ },
+ "VITA_RAE": {
+ "label": "Vitamin A",
+ "quantity": 714.232,
+ "unit": "%"
+ },
+ "VITC": {
+ "label": "Vitamin C",
+ "quantity": 81.42000000000002,
+ "unit": "%"
+ },
+ "THIA": {
+ "label": "Thiamin (B1)",
+ "quantity": 34.04376673333333,
+ "unit": "%"
+ },
+ "RIBF": {
+ "label": "Riboflavin (B2)",
+ "quantity": 22.686235529411764,
+ "unit": "%"
+ },
+ "NIA": {
+ "label": "Niacin (B3)",
+ "quantity": 30.84511551,
+ "unit": "%"
+ },
+ "VITB6A": {
+ "label": "Vitamin B6",
+ "quantity": 58.4199004,
+ "unit": "%"
+ },
+ "FOL": {
+ "label": "Folic Acid (B9)",
+ "quantity": 27.0704503,
+ "unit": "%"
+ },
+ "VITB12": {
+ "label": "Vitamin B12",
+ "quantity": 0.7187667333333332,
+ "unit": "%"
+ },
+ "VITD": {
+ "label": "Vitamin D",
+ "quantity": 0.05324999999999999,
+ "unit": "%"
+ },
+ "TOCPHA": {
+ "label": "Vitamin E",
+ "quantity": 31.439199999999992,
+ "unit": "%"
+ },
+ "VITK1": {
+ "label": "Vitamin K",
+ "quantity": 127.4875,
+ "unit": "%"
+ }
+ },
+ "digest": [
+ {
+ "label": "Fat",
+ "tag": "FAT",
+ "schemaOrgTag": "fatContent",
+ "total": 13.042819999999999,
+ "hasRDI": true,
+ "daily": 20.06587692307692,
+ "unit": "g",
+ "sub": [
+ {
+ "label": "Saturated",
+ "tag": "FASAT",
+ "schemaOrgTag": "saturatedFatContent",
+ "total": 7.486719999999999,
+ "hasRDI": true,
+ "daily": 37.4336,
+ "unit": "g"
+ },
+ {
+ "label": "Trans",
+ "tag": "FATRN",
+ "schemaOrgTag": "transFatContent",
+ "total": 0.46434,
+ "hasRDI": false,
+ "daily": 0,
+ "unit": "g"
+ },
+ {
+ "label": "Monounsaturated",
+ "tag": "FAMS",
+ "schemaOrgTag": nil,
+ "total": 3.0501599999999995,
+ "hasRDI": false,
+ "daily": 0,
+ "unit": "g"
+ },
+ {
+ "label": "Polyunsaturated",
+ "tag": "FAPU",
+ "schemaOrgTag": nil,
+ "total": 1.13368,
+ "hasRDI": false,
+ "daily": 0,
+ "unit": "g"
+ }
+ ]
+ },
+ {
+ "label": "Carbs",
+ "tag": "CHOCDF",
+ "schemaOrgTag": "carbohydrateContent",
+ "total": 76.22889571,
+ "hasRDI": true,
+ "daily": 25.409631903333334,
+ "unit": "g",
+ "sub": [
+ {
+ "label": "Carbs (net)",
+ "tag": "CHOCDF.net",
+ "schemaOrgTag": nil,
+ "total": 60.676895710000004,
+ "hasRDI": false,
+ "daily": 0,
+ "unit": "g"
+ },
+ {
+ "label": "Fiber",
+ "tag": "FIBTG",
+ "schemaOrgTag": "fiberContent",
+ "total": 15.552,
+ "hasRDI": true,
+ "daily": 62.208,
+ "unit": "g"
+ },
+ {
+ "label": "Sugars",
+ "tag": "SUGAR",
+ "schemaOrgTag": "sugarContent",
+ "total": 36.55892,
+ "hasRDI": false,
+ "daily": 0,
+ "unit": "g"
+ }
+ ]
+ },
+ {
+ "label": "Protein",
+ "tag": "PROCNT",
+ "schemaOrgTag": "proteinContent",
+ "total": 7.337778092000001,
+ "hasRDI": true,
+ "daily": 14.675556184000001,
+ "unit": "g"
+ },
+ {
+ "label": "Cholesterol",
+ "tag": "CHOLE",
+ "schemaOrgTag": "cholesterolContent",
+ "total": 30.529999999999998,
+ "hasRDI": true,
+ "daily": 10.176666666666666,
+ "unit": "mg"
+ },
+ {
+ "label": "Sodium",
+ "tag": "NA",
+ "schemaOrgTag": "sodiumContent",
+ "total": 509.12513144957995,
+ "hasRDI": true,
+ "daily": 21.213547143732498,
+ "unit": "mg"
+ },
+ {
+ "label": "Calcium",
+ "tag": "CA",
+ "schemaOrgTag": nil,
+ "total": 224.93416334542522,
+ "hasRDI": true,
+ "daily": 22.493416334542523,
+ "unit": "mg"
+ },
+ {
+ "label": "Magnesium",
+ "tag": "MG",
+ "schemaOrgTag": nil,
+ "total": 97.58009130605939,
+ "hasRDI": true,
+ "daily": 24.395022826514847,
+ "unit": "mg"
+ },
+ {
+ "label": "Potassium",
+ "tag": "K",
+ "schemaOrgTag": nil,
+ "total": 2279.8454262484743,
+ "hasRDI": true,
+ "daily": 65.13844074995642,
+ "unit": "mg"
+ },
+ {
+ "label": "Iron",
+ "tag": "FE",
+ "schemaOrgTag": nil,
+ "total": 2.5736217389995963,
+ "hasRDI": true,
+ "daily": 14.29789854999776,
+ "unit": "mg"
+ },
+ {
+ "label": "Zinc",
+ "tag": "ZN",
+ "schemaOrgTag": nil,
+ "total": 1.6187220126059385,
+ "hasRDI": true,
+ "daily": 10.79148008403959,
+ "unit": "mg"
+ },
+ {
+ "label": "Phosphorus",
+ "tag": "P",
+ "schemaOrgTag": nil,
+ "total": 286.61820279999995,
+ "hasRDI": true,
+ "daily": 40.945457542857135,
+ "unit": "mg"
+ },
+ {
+ "label": "Vitamin A",
+ "tag": "VITA_RAE",
+ "schemaOrgTag": nil,
+ "total": 6428.087999999999,
+ "hasRDI": true,
+ "daily": 714.232,
+ "unit": "µg"
+ },
+ {
+ "label": "Vitamin C",
+ "tag": "VITC",
+ "schemaOrgTag": nil,
+ "total": 48.852000000000004,
+ "hasRDI": true,
+ "daily": 81.42000000000002,
+ "unit": "mg"
+ },
+ {
+ "label": "Thiamin (B1)",
+ "tag": "THIA",
+ "schemaOrgTag": nil,
+ "total": 0.5106565009999999,
+ "hasRDI": true,
+ "daily": 34.04376673333333,
+ "unit": "mg"
+ },
+ {
+ "label": "Riboflavin (B2)",
+ "tag": "RIBF",
+ "schemaOrgTag": nil,
+ "total": 0.38566600399999995,
+ "hasRDI": true,
+ "daily": 22.686235529411764,
+ "unit": "mg"
+ },
+ {
+ "label": "Niacin (B3)",
+ "tag": "NIA",
+ "schemaOrgTag": nil,
+ "total": 6.169023102,
+ "hasRDI": true,
+ "daily": 30.84511551,
+ "unit": "mg"
+ },
+ {
+ "label": "Vitamin B6",
+ "tag": "VITB6A",
+ "schemaOrgTag": nil,
+ "total": 1.168398008,
+ "hasRDI": true,
+ "daily": 58.4199004,
+ "unit": "mg"
+ },
+ {
+ "label": "Folic Acid (B9)",
+ "tag": "FOL",
+ "schemaOrgTag": nil,
+ "total": 108.2818012,
+ "hasRDI": true,
+ "daily": 27.0704503,
+ "unit": "µg"
+ },
+ {
+ "label": "Vitamin B12",
+ "tag": "VITB12",
+ "schemaOrgTag": nil,
+ "total": 0.043126003999999996,
+ "hasRDI": true,
+ "daily": 0.7187667333333332,
+ "unit": "µg"
+ },
+ {
+ "label": "Vitamin D",
+ "tag": "VITD",
+ "schemaOrgTag": nil,
+ "total": 0.21299999999999997,
+ "hasRDI": true,
+ "daily": 0.05324999999999999,
+ "unit": "µg"
+ },
+ {
+ "label": "Vitamin E",
+ "tag": "TOCPHA",
+ "schemaOrgTag": nil,
+ "total": 6.287839999999999,
+ "hasRDI": true,
+ "daily": 31.439199999999992,
+ "unit": "mg"
+ },
+ {
+ "label": "Vitamin K",
+ "tag": "VITK1",
+ "schemaOrgTag": nil,
+ "total": 101.99,
+ "hasRDI": true,
+ "daily": 127.4875,
+ "unit": "µg"
+ }
+ ]
+ },
+ "bookmarked": false,
+ "bought": false
+ },
+ {
+ "recipe": {
+ "uri": "http://www.edamam.com/ontologies/edamam.owl#recipe_be5a134c776c528ff22c664552ccb69a",
+ "label": "Carrots Braised in Beer and Carrot Juice",
+ "image": "https://www.edamam.com/web-img/6d7/6d7c318d7a0e0b11413bbf5c4cc91583.jpg",
+ "source": "Food & Wine",
+ "sourceIcon": "http://www.foodandwine.com/favicon.ico",
+ "url": "http://www.foodandwine.com/recipes/carrots-braised-in-beer-and-carrot-juice",
+ "shareAs": "http://www.edamam.com/recipe/carrots-braised-in-beer-and-carrot-juice-be5a134c776c528ff22c664552ccb69a/carrot",
+ "yield": 4,
+ "dietLabels": [
+ "Low-Sodium"
+ ],
+ "healthLabels": [
+ "Vegetarian",
+ "Egg-Free",
+ "Peanut-Free",
+ "Tree-Nut-Free",
+ "Soy-Free",
+ "Fish-Free",
+ "Shellfish-Free"
+ ],
+ "cautions": [],
+ "ingredientLines": [
+ "8 medium carrots",
+ "1 cup fresh carrot juice",
+ "1/2 cup hoppy beer, such as a pilsner",
+ "1 teaspoon sugar",
+ "1 tablespoon unsalted butter",
+ "Salt"
+ ],
+ "ingredients": [
+ {
+ "text": "8 medium carrots",
+ "quantity": 8,
+ "measure": "medium",
+ "food": "carrots",
+ "weight": 488
+ },
+ {
+ "text": "1 cup fresh carrot juice",
+ "quantity": 1,
+ "measure": "cup",
+ "food": "carrot juice",
+ "weight": 236
+ },
+ {
+ "text": "1/2 cup hoppy beer, such as a pilsner",
+ "quantity": 0.5,
+ "measure": "cup",
+ "food": "beer",
+ "weight": 94.93002
+ },
+ {
+ "text": "1 teaspoon sugar",
+ "quantity": 1,
+ "measure": "tsp",
+ "food": "sugar",
+ "weight": 4.2
+ },
+ {
+ "text": "1 tablespoon unsalted butter",
+ "quantity": 1,
+ "measure": "tbsp",
+ "food": "unsalted butter",
+ "weight": 14.2
+ },
+ {
+ "text": "Salt",
+ "quantity": 0,
+ "measure": "medium",
+ "food": "salt",
+ "weight": 0.029010605938335318
+ }
+ ],
+ "calories": 453.36790859999996,
+ "totalWeight": 837.3590306059384,
+ "totalNutrients": {
+ "ENERC_KCAL": {
+ "label": "Energy",
+ "quantity": 453.36790859999996,
+ "unit": "kcal"
+ },
+ "FAT": {
+ "label": "Fat",
+ "quantity": 13.042819999999999,
+ "unit": "g"
+ },
+ "FASAT": {
+ "label": "Saturated",
+ "quantity": 7.486719999999999,
+ "unit": "g"
+ },
+ "FATRN": {
+ "label": "Trans",
+ "quantity": 0.46434,
+ "unit": "g"
+ },
+ "FAMS": {
+ "label": "Monounsaturated",
+ "quantity": 3.0501599999999995,
+ "unit": "g"
+ },
+ "FAPU": {
+ "label": "Polyunsaturated",
+ "quantity": 1.13368,
+ "unit": "g"
+ },
+ "CHOCDF": {
+ "label": "Carbs",
+ "quantity": 76.22889571,
+ "unit": "g"
+ },
+ "FIBTG": {
+ "label": "Fiber",
+ "quantity": 15.552,
+ "unit": "g"
+ },
+ "SUGAR": {
+ "label": "Sugars",
+ "quantity": 36.55892,
+ "unit": "g"
+ },
+ "PROCNT": {
+ "label": "Protein",
+ "quantity": 7.337778092000001,
+ "unit": "g"
+ },
+ "CHOLE": {
+ "label": "Cholesterol",
+ "quantity": 30.529999999999998,
+ "unit": "mg"
+ },
+ "NA": {
+ "label": "Sodium",
+ "quantity": 509.12513144957995,
+ "unit": "mg"
+ },
+ "CA": {
+ "label": "Calcium",
+ "quantity": 224.93416334542522,
+ "unit": "mg"
+ },
+ "MG": {
+ "label": "Magnesium",
+ "quantity": 97.58009130605939,
+ "unit": "mg"
+ },
+ "K": {
+ "label": "Potassium",
+ "quantity": 2279.8454262484743,
+ "unit": "mg"
+ },
+ "FE": {
+ "label": "Iron",
+ "quantity": 2.5736217389995963,
+ "unit": "mg"
+ },
+ "ZN": {
+ "label": "Zinc",
+ "quantity": 1.6187220126059385,
+ "unit": "mg"
+ },
+ "P": {
+ "label": "Phosphorus",
+ "quantity": 286.61820279999995,
+ "unit": "mg"
+ },
+ "VITA_RAE": {
+ "label": "Vitamin A",
+ "quantity": 6428.087999999999,
+ "unit": "µg_RAE"
+ },
+ "VITC": {
+ "label": "Vitamin C",
+ "quantity": 48.852000000000004,
+ "unit": "mg"
+ },
+ "THIA": {
+ "label": "Thiamin (B1)",
+ "quantity": 0.5106565009999999,
+ "unit": "mg"
+ },
+ "RIBF": {
+ "label": "Riboflavin (B2)",
+ "quantity": 0.38566600399999995,
+ "unit": "mg"
+ },
+ "NIA": {
+ "label": "Niacin (B3)",
+ "quantity": 6.169023102,
+ "unit": "mg"
+ },
+ "VITB6A": {
+ "label": "Vitamin B6",
+ "quantity": 1.168398008,
+ "unit": "mg"
+ },
+ "FOL": {
+ "label": "Folic Acid (B9)",
+ "quantity": 108.2818012,
+ "unit": "µg"
+ },
+ "VITB12": {
+ "label": "Vitamin B12",
+ "quantity": 0.043126003999999996,
+ "unit": "µg"
+ },
+ "VITD": {
+ "label": "Vitamin D",
+ "quantity": 0.21299999999999997,
+ "unit": "µg"
+ },
+ "TOCPHA": {
+ "label": "Vitamin E",
+ "quantity": 6.287839999999999,
+ "unit": "mg"
+ },
+ "VITK1": {
+ "label": "Vitamin K",
+ "quantity": 101.99,
+ "unit": "µg"
+ }
+ },
+ "totalDaily": {
+ "ENERC_KCAL": {
+ "label": "Energy",
+ "quantity": 22.668395429999997,
+ "unit": "%"
+ },
+ "FAT": {
+ "label": "Fat",
+ "quantity": 20.06587692307692,
+ "unit": "%"
+ },
+ "FASAT": {
+ "label": "Saturated",
+ "quantity": 37.4336,
+ "unit": "%"
+ },
+ "CHOCDF": {
+ "label": "Carbs",
+ "quantity": 25.409631903333334,
+ "unit": "%"
+ },
+ "FIBTG": {
+ "label": "Fiber",
+ "quantity": 62.208,
+ "unit": "%"
+ },
+ "PROCNT": {
+ "label": "Protein",
+ "quantity": 14.675556184000001,
+ "unit": "%"
+ },
+ "CHOLE": {
+ "label": "Cholesterol",
+ "quantity": 10.176666666666666,
+ "unit": "%"
+ },
+ "NA": {
+ "label": "Sodium",
+ "quantity": 21.213547143732498,
+ "unit": "%"
+ },
+ "CA": {
+ "label": "Calcium",
+ "quantity": 22.493416334542523,
+ "unit": "%"
+ },
+ "MG": {
+ "label": "Magnesium",
+ "quantity": 24.395022826514847,
+ "unit": "%"
+ },
+ "K": {
+ "label": "Potassium",
+ "quantity": 65.13844074995642,
+ "unit": "%"
+ },
+ "FE": {
+ "label": "Iron",
+ "quantity": 14.29789854999776,
+ "unit": "%"
+ },
+ "ZN": {
+ "label": "Zinc",
+ "quantity": 10.79148008403959,
+ "unit": "%"
+ },
+ "P": {
+ "label": "Phosphorus",
+ "quantity": 40.945457542857135,
+ "unit": "%"
+ },
+ "VITA_RAE": {
+ "label": "Vitamin A",
+ "quantity": 714.232,
+ "unit": "%"
+ },
+ "VITC": {
+ "label": "Vitamin C",
+ "quantity": 81.42000000000002,
+ "unit": "%"
+ },
+ "THIA": {
+ "label": "Thiamin (B1)",
+ "quantity": 34.04376673333333,
+ "unit": "%"
+ },
+ "RIBF": {
+ "label": "Riboflavin (B2)",
+ "quantity": 22.686235529411764,
+ "unit": "%"
+ },
+ "NIA": {
+ "label": "Niacin (B3)",
+ "quantity": 30.84511551,
+ "unit": "%"
+ },
+ "VITB6A": {
+ "label": "Vitamin B6",
+ "quantity": 58.4199004,
+ "unit": "%"
+ },
+ "FOL": {
+ "label": "Folic Acid (B9)",
+ "quantity": 27.0704503,
+ "unit": "%"
+ },
+ "VITB12": {
+ "label": "Vitamin B12",
+ "quantity": 0.7187667333333332,
+ "unit": "%"
+ },
+ "VITD": {
+ "label": "Vitamin D",
+ "quantity": 0.05324999999999999,
+ "unit": "%"
+ },
+ "TOCPHA": {
+ "label": "Vitamin E",
+ "quantity": 31.439199999999992,
+ "unit": "%"
+ },
+ "VITK1": {
+ "label": "Vitamin K",
+ "quantity": 127.4875,
+ "unit": "%"
+ }
+ },
+ "digest": [
+ {
+ "label": "Fat",
+ "tag": "FAT",
+ "schemaOrgTag": "fatContent",
+ "total": 13.042819999999999,
+ "hasRDI": true,
+ "daily": 20.06587692307692,
+ "unit": "g",
+ "sub": [
+ {
+ "label": "Saturated",
+ "tag": "FASAT",
+ "schemaOrgTag": "saturatedFatContent",
+ "total": 7.486719999999999,
+ "hasRDI": true,
+ "daily": 37.4336,
+ "unit": "g"
+ },
+ {
+ "label": "Trans",
+ "tag": "FATRN",
+ "schemaOrgTag": "transFatContent",
+ "total": 0.46434,
+ "hasRDI": false,
+ "daily": 0,
+ "unit": "g"
+ },
+ {
+ "label": "Monounsaturated",
+ "tag": "FAMS",
+ "schemaOrgTag": nil,
+ "total": 3.0501599999999995,
+ "hasRDI": false,
+ "daily": 0,
+ "unit": "g"
+ },
+ {
+ "label": "Polyunsaturated",
+ "tag": "FAPU",
+ "schemaOrgTag": nil,
+ "total": 1.13368,
+ "hasRDI": false,
+ "daily": 0,
+ "unit": "g"
+ }
+ ]
+ },
+ {
+ "label": "Carbs",
+ "tag": "CHOCDF",
+ "schemaOrgTag": "carbohydrateContent",
+ "total": 76.22889571,
+ "hasRDI": true,
+ "daily": 25.409631903333334,
+ "unit": "g",
+ "sub": [
+ {
+ "label": "Carbs (net)",
+ "tag": "CHOCDF.net",
+ "schemaOrgTag": nil,
+ "total": 60.676895710000004,
+ "hasRDI": false,
+ "daily": 0,
+ "unit": "g"
+ },
+ {
+ "label": "Fiber",
+ "tag": "FIBTG",
+ "schemaOrgTag": "fiberContent",
+ "total": 15.552,
+ "hasRDI": true,
+ "daily": 62.208,
+ "unit": "g"
+ },
+ {
+ "label": "Sugars",
+ "tag": "SUGAR",
+ "schemaOrgTag": "sugarContent",
+ "total": 36.55892,
+ "hasRDI": false,
+ "daily": 0,
+ "unit": "g"
+ }
+ ]
+ },
+ {
+ "label": "Protein",
+ "tag": "PROCNT",
+ "schemaOrgTag": "proteinContent",
+ "total": 7.337778092000001,
+ "hasRDI": true,
+ "daily": 14.675556184000001,
+ "unit": "g"
+ },
+ {
+ "label": "Cholesterol",
+ "tag": "CHOLE",
+ "schemaOrgTag": "cholesterolContent",
+ "total": 30.529999999999998,
+ "hasRDI": true,
+ "daily": 10.176666666666666,
+ "unit": "mg"
+ },
+ {
+ "label": "Sodium",
+ "tag": "NA",
+ "schemaOrgTag": "sodiumContent",
+ "total": 509.12513144957995,
+ "hasRDI": true,
+ "daily": 21.213547143732498,
+ "unit": "mg"
+ },
+ {
+ "label": "Calcium",
+ "tag": "CA",
+ "schemaOrgTag": nil,
+ "total": 224.93416334542522,
+ "hasRDI": true,
+ "daily": 22.493416334542523,
+ "unit": "mg"
+ },
+ {
+ "label": "Magnesium",
+ "tag": "MG",
+ "schemaOrgTag": nil,
+ "total": 97.58009130605939,
+ "hasRDI": true,
+ "daily": 24.395022826514847,
+ "unit": "mg"
+ },
+ {
+ "label": "Potassium",
+ "tag": "K",
+ "schemaOrgTag": nil,
+ "total": 2279.8454262484743,
+ "hasRDI": true,
+ "daily": 65.13844074995642,
+ "unit": "mg"
+ },
+ {
+ "label": "Iron",
+ "tag": "FE",
+ "schemaOrgTag": nil,
+ "total": 2.5736217389995963,
+ "hasRDI": true,
+ "daily": 14.29789854999776,
+ "unit": "mg"
+ },
+ {
+ "label": "Zinc",
+ "tag": "ZN",
+ "schemaOrgTag": nil,
+ "total": 1.6187220126059385,
+ "hasRDI": true,
+ "daily": 10.79148008403959,
+ "unit": "mg"
+ },
+ {
+ "label": "Phosphorus",
+ "tag": "P",
+ "schemaOrgTag": nil,
+ "total": 286.61820279999995,
+ "hasRDI": true,
+ "daily": 40.945457542857135,
+ "unit": "mg"
+ },
+ {
+ "label": "Vitamin A",
+ "tag": "VITA_RAE",
+ "schemaOrgTag": nil,
+ "total": 6428.087999999999,
+ "hasRDI": true,
+ "daily": 714.232,
+ "unit": "µg"
+ },
+ {
+ "label": "Vitamin C",
+ "tag": "VITC",
+ "schemaOrgTag": nil,
+ "total": 48.852000000000004,
+ "hasRDI": true,
+ "daily": 81.42000000000002,
+ "unit": "mg"
+ },
+ {
+ "label": "Thiamin (B1)",
+ "tag": "THIA",
+ "schemaOrgTag": nil,
+ "total": 0.5106565009999999,
+ "hasRDI": true,
+ "daily": 34.04376673333333,
+ "unit": "mg"
+ },
+ {
+ "label": "Riboflavin (B2)",
+ "tag": "RIBF",
+ "schemaOrgTag": nil,
+ "total": 0.38566600399999995,
+ "hasRDI": true,
+ "daily": 22.686235529411764,
+ "unit": "mg"
+ },
+ {
+ "label": "Niacin (B3)",
+ "tag": "NIA",
+ "schemaOrgTag": nil,
+ "total": 6.169023102,
+ "hasRDI": true,
+ "daily": 30.84511551,
+ "unit": "mg"
+ },
+ {
+ "label": "Vitamin B6",
+ "tag": "VITB6A",
+ "schemaOrgTag": nil,
+ "total": 1.168398008,
+ "hasRDI": true,
+ "daily": 58.4199004,
+ "unit": "mg"
+ },
+ {
+ "label": "Folic Acid (B9)",
+ "tag": "FOL",
+ "schemaOrgTag": nil,
+ "total": 108.2818012,
+ "hasRDI": true,
+ "daily": 27.0704503,
+ "unit": "µg"
+ },
+ {
+ "label": "Vitamin B12",
+ "tag": "VITB12",
+ "schemaOrgTag": nil,
+ "total": 0.043126003999999996,
+ "hasRDI": true,
+ "daily": 0.7187667333333332,
+ "unit": "µg"
+ },
+ {
+ "label": "Vitamin D",
+ "tag": "VITD",
+ "schemaOrgTag": nil,
+ "total": 0.21299999999999997,
+ "hasRDI": true,
+ "daily": 0.05324999999999999,
+ "unit": "µg"
+ },
+ {
+ "label": "Vitamin E",
+ "tag": "TOCPHA",
+ "schemaOrgTag": nil,
+ "total": 6.287839999999999,
+ "hasRDI": true,
+ "daily": 31.439199999999992,
+ "unit": "mg"
+ },
+ {
+ "label": "Vitamin K",
+ "tag": "VITK1",
+ "schemaOrgTag": nil,
+ "total": 101.99,
+ "hasRDI": true,
+ "daily": 127.4875,
+ "unit": "µg"
+ }
+ ]
+ },
+ "bookmarked": false,
+ "bought": false
+ }
+ ]
+ }
+end
+
\ No newline at end of file
diff --git a/lib/tasks/.keep b/lib/tasks/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/log/.keep b/log/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/public/404.html b/public/404.html
new file mode 100644
index 000000000..b612547fc
--- /dev/null
+++ b/public/404.html
@@ -0,0 +1,67 @@
+
+
+
+
The page you were looking for doesn't exist (404)
+
+
+
+
+
+
+
+
+
The page you were looking for doesn't exist.
+
You may have mistyped the address or the page may have moved.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/public/422.html b/public/422.html
new file mode 100644
index 000000000..a21f82b3b
--- /dev/null
+++ b/public/422.html
@@ -0,0 +1,67 @@
+
+
+
+
The change you wanted was rejected (422)
+
+
+
+
+
+
+
+
+
The change you wanted was rejected.
+
Maybe you tried to change something you didn't have access to.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/public/500.html b/public/500.html
new file mode 100644
index 000000000..061abc587
--- /dev/null
+++ b/public/500.html
@@ -0,0 +1,66 @@
+
+
+
+
We're sorry, but something went wrong (500)
+
+
+
+
+
+
+
+
+
We're sorry, but something went wrong.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/public/favicon.ico b/public/favicon.ico
new file mode 100644
index 000000000..e69de29bb
diff --git a/public/robots.txt b/public/robots.txt
new file mode 100644
index 000000000..3c9c7c01f
--- /dev/null
+++ b/public/robots.txt
@@ -0,0 +1,5 @@
+# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
+#
+# To ban all spiders from the entire site uncomment the next two lines:
+# User-agent: *
+# Disallow: /
diff --git a/test/controllers/.keep b/test/controllers/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/controllers/recipes_controller_test.rb b/test/controllers/recipes_controller_test.rb
new file mode 100644
index 000000000..590b06c39
--- /dev/null
+++ b/test/controllers/recipes_controller_test.rb
@@ -0,0 +1,44 @@
+require 'test_helper'
+
+class RecipesControllerTest < ActionController::TestCase
+ test "should get search" do
+ get :search
+ assert_response :success
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ end
+
+ test "should get show" do
+ get :show
+ assert_response :success
+ end
+
+ 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 edit" do
+ get :edit
+ assert_response :success
+ end
+
+ test "should get update" do
+ get :update
+ assert_response :success
+ end
+
+ test "should get destroy" do
+ get :destroy
+ assert_response :success
+ end
+
+end
diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb
new file mode 100644
index 000000000..3f3cbf1bb
--- /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
+ # get :destroy
+ # assert_response :success
+ # end
+
+end
diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb
new file mode 100644
index 000000000..36378fec0
--- /dev/null
+++ b/test/controllers/users_controller_test.rb
@@ -0,0 +1,39 @@
+require 'test_helper'
+
+class UsersControllerTest < ActionController::TestCase
+ # test "should get index" do
+ # get :index
+ # assert_response :success
+ # end
+
+ # test "should get show" do
+ # get :show
+ # assert_response :success
+ # end
+
+ # 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 edit" do
+ # get :edit
+ # assert_response :success
+ # end
+
+ # test "should get update" do
+ # get :update
+ # assert_response :success
+ # end
+
+ # test "should get destroy" do
+ # get :destroy
+ # assert_response :success
+ # end
+
+end
diff --git a/test/fixtures/.keep b/test/fixtures/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml
new file mode 100644
index 000000000..5dc4ddf03
--- /dev/null
+++ b/test/fixtures/users.yml
@@ -0,0 +1,9 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+one:
+ name: MyString
+ email: MyString
+
+two:
+ name: MyString
+ email: MyString
diff --git a/test/helpers/.keep b/test/helpers/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/integration/.keep b/test/integration/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/lib/recipe_result_test.rb b/test/lib/recipe_result_test.rb
new file mode 100644
index 000000000..19245741e
--- /dev/null
+++ b/test/lib/recipe_result_test.rb
@@ -0,0 +1,47 @@
+require 'test_helper'
+require 'recipe_result'
+
+class RecipeResultTest < ActionController::TestCase
+#make sure rake is picking up the test
+ test "the truth" do
+ assert true
+ end
+
+ test 'Must Provide a URI and a Label for a Recipe Result' do
+
+ assert_raises ArgumentError do
+ RecipeResult.new nil, nil
+ end
+
+ assert_raises ArgumentError do
+ RecipeResult.new "", ""
+ end
+
+ assert_raises ArgumentError do
+ RecipeResult.new "", "SomeLabel"
+ end
+
+ assert_raises ArgumentError do
+ RecipeResult.new "SomeURI", ""
+ end
+
+ assert_raises ArgumentError do
+ RecipeResult.new "SomeURI", nil
+ end
+
+ assert_raises ArgumentError do
+ RecipeResult.new nil, "SomeLabel"
+ end
+ end
+
+ test "Name Attribute is Set Correctly" do
+ test_me = RecipeResult.new "SomeURI", "SomeLabel"
+ assert test_me.label == "SomeLabel"
+ end
+
+ test "ID Attribute is Set Correctly" do
+ test_me = RecipeResult.new "SomeURI", "SomeLabel"
+ assert test_me.uri == "SomeURI"
+ end
+
+end
\ No newline at end of file
diff --git a/test/lib/recipe_search_wrapper_test.rb b/test/lib/recipe_search_wrapper_test.rb
new file mode 100644
index 000000000..6d37dcafd
--- /dev/null
+++ b/test/lib/recipe_search_wrapper_test.rb
@@ -0,0 +1,57 @@
+require 'test_helper'
+require 'recipe_search_wrapper'
+
+class RecipeSearchWrapperTest < ActionController::TestCase
+
+#make sure rake is picking up the test
+ test "the truth" do
+ assert true
+ end
+
+ test "Can Retrieve a List of Recipes" do
+
+ VCR.use_cassette("recipe-list") do
+
+ recipes = RecipeSearchWrapper.search_by_one_keyword("carrot")
+
+ assert recipes.length > 0
+ assert recipes.is_a? Array
+ assert_not recipes.is_empty?
+ end
+
+
+ end
+
+ test "Searches without a Keyword Fail" do
+ VCR.use_cassette("no-keyword") do
+ recipes = RecipeSearchWrapper.search_by_one_keyword("")
+
+ assert recipes == nil
+ end
+ end
+
+
+ # test "Retrieves Nil When the App ID is Wrong" do
+ # VCR.use_cassette("bad-token") do
+ # recipes = RecipeSearchWrapper.search_by_one_keyword("carrot", "bad-token")
+
+ # assert recipes == Error 500
+ # end
+ # end
+
+ test "Retrieves Nil When the App Key is Wrong" do
+ VCR.use_cassette("bad-key") do
+ recipes = RecipeSearchWrapper.search_by_one_keyword("carrot", "bad-token")
+
+ assert recipes == nil
+ end
+ end
+
+ test "Retrieves Nil When the Keyword is not an Option" do
+ VCR.use_cassette("bad-keyword") do
+ recipes = RecipeSearchWrapper.search_by_one_keyword("grok")
+
+ assert recipes == nil
+ end
+ end
+end
\ No newline at end of file
diff --git a/test/mailers/.keep b/test/mailers/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/models/.keep b/test/models/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/models/user_test.rb b/test/models/user_test.rb
new file mode 100644
index 000000000..82f61e010
--- /dev/null
+++ b/test/models/user_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class UserTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/test_helper.rb b/test/test_helper.rb
new file mode 100644
index 000000000..f89485dc4
--- /dev/null
+++ b/test/test_helper.rb
@@ -0,0 +1,36 @@
+ENV['RAILS_ENV'] ||= 'test'
+require File.expand_path('../../config/environment', __FILE__)
+
+require 'rails/test_help'
+
+require 'vcr'
+require 'webmock/minitest'
+
+require "minitest/reporters"
+
+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...
+
+
+ Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
+
+ VCR.configure do |config|
+ config.cassette_library_dir = 'test/cassettes' # folder where casettes will be located
+ config.hook_into :webmock # tie into this other tool called webmock
+ config.default_cassette_options = {
+ :record => :new_episodes # record new data when we don't have it yet
+ }
+
+ config.filter_sensitive_data("
") do
+ ENV['API_ID']
+ end
+
+ config.filter_sensitive_data("") do
+ ENV['API_KEY']
+ end
+ end
+
+end
diff --git a/vendor/assets/javascripts/.keep b/vendor/assets/javascripts/.keep
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/assets/stylesheets/.keep b/vendor/assets/stylesheets/.keep
new file mode 100644
index 000000000..e69de29bb