diff --git a/.ruby-version b/.ruby-version index cb506813..7c327287 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.0.0-p247 +2.1.1 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index e32ccbea..b33c2e33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,12 @@ language: ruby cache: bundler script: + - bundle exec rake db:setup RAILS_ENV=test + - bundle exec rake db:test:prepare - bundle exec rake spec - bundle exec rake cucumber rvm: - - 2.0.0 + - 2.1.1 notifications: irc: "chat.freenode.com#refugerestrooms" skip_join: true diff --git a/Gemfile b/Gemfile index c6994b70..6fdcfe6f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' -ruby '2.0.0' +ruby '2.1.1' -gem 'rails', '4.0.5' +gem 'rails', '4.1.6' gem 'pg' gem 'pg_search' gem 'sass-rails', '~> 4.0.3' @@ -29,6 +29,11 @@ gem 'grape-swagger' gem 'grape-kaminari' gem 'kaminari' +# Bugsnag sends bug alerts caught in production. +# It's free for open source projects. +gem 'bugsnag' + + gem 'rack-contrib' gem 'rack-cors', :require => 'rack/cors' diff --git a/Gemfile.lock b/Gemfile.lock index baca128b..a4ef2151 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,67 +1,75 @@ GIT remote: https://github.com/gregbell/active_admin.git - revision: f5affaeb84a5c1a86ecefb48ec1099921787e6d9 + revision: 327c62d9f8f5ad39f7cf9363f2195b44076e3baa specs: activeadmin (1.0.0.pre) - arbre (~> 1.0) + arbre (~> 1.0, >= 1.0.2) bourbon coffee-rails - formtastic (~> 2.3.0.rc3) - inherited_resources (~> 1.3) + formtastic (~> 3.0) + formtastic_i18n + inherited_resources (~> 1.4, != 1.5.0) jquery-rails - jquery-ui-rails + jquery-ui-rails (~> 5.0) kaminari (~> 0.15) rails (>= 3.2, < 4.2) - ransack (~> 1.0) + ransack (~> 1.3) sass-rails GEM remote: https://rubygems.org/ specs: - actionmailer (4.0.5) - actionpack (= 4.0.5) - mail (~> 2.5.4) - actionpack (4.0.5) - activesupport (= 4.0.5) - builder (~> 3.1.0) - erubis (~> 2.7.0) + actionmailer (4.1.6) + actionpack (= 4.1.6) + actionview (= 4.1.6) + mail (~> 2.5, >= 2.5.4) + actionpack (4.1.6) + actionview (= 4.1.6) + activesupport (= 4.1.6) rack (~> 1.5.2) rack-test (~> 0.6.2) - activemodel (4.0.5) - activesupport (= 4.0.5) - builder (~> 3.1.0) - activerecord (4.0.5) - activemodel (= 4.0.5) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.5) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.5) + actionview (4.1.6) + activesupport (= 4.1.6) + builder (~> 3.1) + erubis (~> 2.7.0) + activemodel (4.1.6) + activesupport (= 4.1.6) + builder (~> 3.1) + activerecord (4.1.6) + activemodel (= 4.1.6) + activesupport (= 4.1.6) + arel (~> 5.0.0) + activesupport (4.1.6) i18n (~> 0.6, >= 0.6.9) - minitest (~> 4.2) - multi_json (~> 1.3) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) thread_safe (~> 0.1) - tzinfo (~> 0.3.37) + tzinfo (~> 1.1) addressable (2.3.6) - arbre (1.0.1) + arbre (1.0.2) activesupport (>= 3.0.0) - arel (4.0.2) - axiom-types (0.0.5) - descendants_tracker (~> 0.0.1) - ice_nine (~> 0.9) - bcrypt-ruby (3.1.2) - better_errors (1.1.0) + arel (5.0.1.20140414130214) + axiom-types (0.1.1) + descendants_tracker (~> 0.0.4) + ice_nine (~> 0.11.0) + thread_safe (~> 0.3, >= 0.3.1) + bcrypt (3.1.9) + better_errors (2.0.0) coderay (>= 1.0.0) erubis (>= 2.6.6) + rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bootstrap-sass (3.1.1.0) + bootstrap-sass (3.3.1.0) sass (~> 3.2) - bourbon (3.2.1) + bourbon (3.2.3) sass (~> 3.2) thor - builder (3.1.4) - capybara (2.2.1) + bugsnag (2.5.1) + httparty (>= 0.6, < 1.0) + multi_json (~> 1.0) + builder (3.2.2) + capybara (2.4.4) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) @@ -74,134 +82,138 @@ GEM coffee-rails (4.0.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) - coffee-script (2.2.0) + coffee-script (2.3.0) coffee-script-source execjs - coffee-script-source (1.7.0) + coffee-script-source (1.8.0) countries (0.9.3) currencies (~> 0.4.2) - country_select (1.3.1) - countries (= 0.9.3) + country_select (2.1.0) + countries (~> 0.9, >= 0.9.3) crack (0.4.2) safe_yaml (~> 1.0.0) - cucumber (1.3.14) + cucumber (1.3.17) builder (>= 2.1.2) diff-lcs (>= 1.1.3) gherkin (~> 2.12) multi_json (>= 1.7.5, < 2.0) multi_test (>= 0.1.1) - cucumber-rails (1.4.1) + cucumber-rails (1.4.2) capybara (>= 1.1.2, < 3) cucumber (>= 1.3.8, < 2) - mime-types (~> 1.16) + mime-types (>= 1.16, < 3) nokogiri (~> 1.5) rails (>= 3, < 5) currencies (0.4.2) - database_cleaner (1.2.0) + database_cleaner (1.3.0) debug_inspector (0.0.2) - descendants_tracker (0.0.3) - devise (3.2.2) - bcrypt-ruby (~> 3.0) + descendants_tracker (0.0.4) + thread_safe (~> 0.3, >= 0.3.1) + devise (3.4.1) + bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) + responders thread_safe (~> 0.1) warden (~> 1.2.3) diff-lcs (1.2.5) - dotenv (0.10.0) - dotenv-rails (0.10.0) - dotenv (= 0.10.0) + dotenv (1.0.2) + dotenv-rails (1.0.2) + dotenv (= 1.0.2) equalizer (0.0.9) erubis (2.7.0) - execjs (2.0.2) - factory_girl (4.4.0) + execjs (2.2.2) + factory_girl (4.5.0) activesupport (>= 3.0.0) - factory_girl_rails (4.4.1) - factory_girl (~> 4.4.0) + factory_girl_rails (4.5.0) + factory_girl (~> 4.5.0) railties (>= 3.0.0) - formtastic (2.3.0.rc3) - actionpack (>= 3.0) - geocoder (1.2.1) + formtastic (3.0.0) + actionpack (>= 3.2.13) + formtastic_i18n (0.1.1) + geocoder (1.2.6) gherkin (2.12.2) multi_json (~> 1.3) - grape (0.6.1) + grape (0.9.0) activesupport builder - hashie (>= 1.2.0) + hashie (>= 2.1.0) multi_json (>= 1.3.2) multi_xml (>= 0.5.2) rack (>= 1.3.0) rack-accept rack-mount virtus (>= 1.0.0) - grape-entity (0.4.1) + grape-entity (0.4.4) activesupport multi_json (>= 1.3.2) - grape-kaminari (0.1.0) + grape-kaminari (0.1.6) grape kaminari - grape-swagger (0.7.2) - grape (>= 0.2.0) - grape-entity (>= 0.3.0) - kramdown (>= 1.3.1) + grape-swagger (0.8.0) + grape + grape-entity haml (4.0.5) tilt has_scope (0.6.0.rc) actionpack (>= 3.2, < 5) activesupport (>= 3.2, < 5) - hashie (2.0.5) + hashie (3.3.1) hike (1.2.3) + httparty (0.13.3) + json (~> 1.8) + multi_xml (>= 0.5.2) i18n (0.6.11) - ice_nine (0.10.0) - inherited_resources (1.4.1) + ice_nine (0.11.0) + inherited_resources (1.5.1) + actionpack (>= 3.2, < 4.2) has_scope (~> 0.6.0.rc) - responders (~> 1.0.0.rc) + railties (>= 3.2, < 4.2) + responders (~> 1.0) jbuilder (1.5.3) activesupport (>= 3.0.0) multi_json (>= 1.2.0) - jquery-rails (3.1.0) + jquery-rails (3.1.2) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (4.2.1) + jquery-ui-rails (5.0.2) railties (>= 3.2.16) json (1.8.1) - kaminari (0.15.1) + kaminari (0.16.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - kramdown (1.3.2) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) + mail (2.6.3) + mime-types (>= 1.16, < 3) mail_form (1.5.0) actionmailer (>= 3.2, < 5) activemodel (>= 3.2, < 5) method_source (0.8.2) - mime-types (1.25.1) - mini_portile (0.5.3) - minitest (4.7.5) + mime-types (2.4.3) + mini_portile (0.6.1) + minitest (5.4.3) multi_json (1.10.1) multi_test (0.1.1) multi_xml (0.5.5) - nokogiri (1.6.1) - mini_portile (~> 0.5.0) + nokogiri (1.6.4.1) + mini_portile (~> 0.6.0) orm_adapter (0.5.0) pg (0.17.1) - pg_search (0.7.3) + pg_search (0.7.8) activerecord (>= 3.1) activesupport (>= 3.1) arel - poltergeist (1.5.0) + poltergeist (1.5.1) capybara (~> 2.1) cliver (~> 0.3.1) multi_json (~> 1.0) websocket-driver (>= 0.2.0) - polyamorous (1.0.0) + polyamorous (1.1.0) activerecord (>= 3.0) - polyglot (0.3.4) pry (0.9.12.6) coderay (~> 1.0) method_source (~> 0.8) slop (~> 3.4) - quiet_assets (1.0.2) + quiet_assets (1.0.3) railties (>= 3.1, < 5.0) rack (1.5.2) rack-accept (0.4.5) @@ -213,66 +225,64 @@ GEM rack (>= 1.0.0) rack-test (0.6.2) rack (>= 1.0) - rails (4.0.5) - actionmailer (= 4.0.5) - actionpack (= 4.0.5) - activerecord (= 4.0.5) - activesupport (= 4.0.5) + rails (4.1.6) + actionmailer (= 4.1.6) + actionpack (= 4.1.6) + actionview (= 4.1.6) + activemodel (= 4.1.6) + activerecord (= 4.1.6) + activesupport (= 4.1.6) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.5) - sprockets-rails (~> 2.0.0) - rails_12factor (0.0.2) + railties (= 4.1.6) + sprockets-rails (~> 2.0) + rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging rails_serve_static_assets (0.0.2) rails_stdout_logging (0.0.3) - railties (4.0.5) - actionpack (= 4.0.5) - activesupport (= 4.0.5) + railties (4.1.6) + actionpack (= 4.1.6) + activesupport (= 4.1.6) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (10.3.2) rakismet (1.5.0) - ransack (1.2.3) + ransack (1.5.1) actionpack (>= 3.0) activerecord (>= 3.0) activesupport (>= 3.0) i18n - polyamorous (~> 1.0.0) - rdoc (4.1.1) + polyamorous (~> 1.1) + rdoc (4.1.2) json (~> 1.4) - responders (1.0.0) - railties (>= 3.2, < 5) - rspec-collection_matchers (0.0.4) - rspec-expectations (>= 2.99.0.beta1) - rspec-core (3.0.0.beta2) - rspec-support (= 3.0.0.beta2) - rspec-expectations (3.0.0.beta2) + responders (1.1.2) + railties (>= 3.2, < 4.2) + rspec-core (3.0.4) + rspec-support (~> 3.0.0) + rspec-expectations (3.0.4) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (= 3.0.0.beta2) - rspec-mocks (3.0.0.beta2) - rspec-support (= 3.0.0.beta2) - rspec-rails (3.0.0.beta2) + rspec-support (~> 3.0.0) + rspec-mocks (3.0.4) + rspec-support (~> 3.0.0) + rspec-rails (3.0.2) actionpack (>= 3.0) - activemodel (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec-collection_matchers - rspec-core (= 3.0.0.beta2) - rspec-expectations (= 3.0.0.beta2) - rspec-mocks (= 3.0.0.beta2) - rspec-support (= 3.0.0.beta2) - rspec-support (3.0.0.beta2) - safe_yaml (1.0.3) + rspec-core (~> 3.0.0) + rspec-expectations (~> 3.0.0) + rspec-mocks (~> 3.0.0) + rspec-support (~> 3.0.0) + rspec-support (3.0.4) + safe_yaml (1.0.4) sass (3.2.19) sass-rails (4.0.4) railties (>= 4.0.0, < 5.0) sass (~> 3.2.2) sprockets (~> 2.8, < 2.12) sprockets-rails (~> 2.0) - sdoc (0.4.0) - json (~> 1.8) - rdoc (~> 4.0, < 5.0) + sdoc (0.4.1) + json (~> 1.7, >= 1.7.7) + rdoc (~> 4.0) simple_form (3.0.2) actionpack (~> 4.0) activemodel (~> 4.0) @@ -280,39 +290,37 @@ GEM multi_json (~> 1.0) simplecov-html (~> 0.7.1) simplecov-html (0.7.1) - slop (3.4.7) + slop (3.6.0) sprockets (2.11.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.1) + sprockets-rails (2.2.0) actionpack (>= 3.0) activesupport (>= 3.0) - sprockets (~> 2.8) + sprockets (>= 2.8, < 4.0) thor (0.19.1) thread_safe (0.3.4) tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - turbolinks (2.2.1) + turbolinks (2.5.2) coffee-rails - tzinfo (0.3.42) - uglifier (2.4.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (2.5.3) execjs (>= 0.3.0) json (>= 1.8.0) - virtus (1.0.1) - axiom-types (~> 0.0.5) + virtus (1.0.3) + axiom-types (~> 0.1) coercible (~> 1.0) - descendants_tracker (~> 0.0.1) - equalizer (~> 0.0.7) + descendants_tracker (~> 0.0, >= 0.0.3) + equalizer (~> 0.0, >= 0.0.9) warden (1.2.3) rack (>= 1.0) webmock (1.18.0) addressable (>= 2.3.6) crack (>= 0.3.2) - websocket-driver (0.3.2) + websocket-driver (0.4.0) xpath (2.0.0) nokogiri (~> 1.3) @@ -324,6 +332,7 @@ DEPENDENCIES better_errors binding_of_caller bootstrap-sass + bugsnag coffee-rails (~> 4.0.0) country_select cucumber-rails (~> 1.4.1) @@ -347,7 +356,7 @@ DEPENDENCIES quiet_assets (~> 1.0.2) rack-contrib rack-cors - rails (= 4.0.5) + rails (= 4.1.6) rails_12factor rake rakismet diff --git a/bin/rails b/bin/rails index 7feb6a30..728cd85a 100755 --- a/bin/rails +++ b/bin/rails @@ -1,8 +1,4 @@ #!/usr/bin/env ruby -begin - load File.expand_path("../spring", __FILE__) -rescue LoadError -end APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/rake b/bin/rake index 8017a027..17240489 100755 --- a/bin/rake +++ b/bin/rake @@ -1,8 +1,4 @@ #!/usr/bin/env ruby -begin - load File.expand_path("../spring", __FILE__) -rescue LoadError -end require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/config/application.rb b/config/application.rb index 91555fae..4ac875a5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -4,7 +4,7 @@ # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) +Bundler.require(*Rails.groups) module SaferstallsRails class Application < Rails::Application @@ -16,11 +16,10 @@ class Application < Rails::Application # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' - I18n.config.enforce_available_locales = true - # 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 = :en + config.middleware.insert_before 0, "Rack::Cors" do allow do origins "*" diff --git a/config/boot.rb b/config/boot.rb index 33b8c694..49d751f4 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,7 +1,4 @@ # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) - -# If on osx and java_exec fails, try this -#ENV['EXECJS_RUNTIME'] = 'JavaScriptCore' +require "bundler/setup" if File.exist?(ENV['BUNDLE_GEMFILE']) diff --git a/config/environment.rb b/config/environment.rb index add7d8d0..ee8d90dc 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -2,4 +2,4 @@ require File.expand_path('../application', __FILE__) # Initialize the Rails application. -SaferstallsRails::Application.initialize! \ No newline at end of file +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index eb80c796..ddf0e90c 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,4 +1,4 @@ -SaferstallsRails::Application.configure do +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 @@ -19,13 +19,19 @@ # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Raise an error on page load if there are pending migrations + # 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 -end - \ No newline at end of file + # 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 index 3a42bbcb..a6081ba4 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,11 +1,11 @@ -SaferstallsRails::Application.configure do +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 thread web servers + # 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 @@ -32,8 +32,8 @@ # Generate digests for assets URLs. config.assets.digest = true - # Version of your assets, change this if you want to expire all your assets. - config.assets.version = '1.0' + # `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 @@ -57,16 +57,12 @@ # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = "http://assets.example.com" - # Precompile additional assets. - # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. - # config.assets.precompile += %w( search.js ) - # 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 can not be found). + # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true # Send deprecation notices to registered listeners. @@ -77,4 +73,7 @@ # 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 index 054638bb..6bbe9c4c 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,4 @@ -SaferstallsRails::Application.configure do +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 @@ -34,5 +34,6 @@ # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - config.log_level = :warn + # 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 00000000..1f4bba75 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,9 @@ +# 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" + +# 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/bugsnag.rb b/config/initializers/bugsnag.rb new file mode 100644 index 00000000..ee363d09 --- /dev/null +++ b/config/initializers/bugsnag.rb @@ -0,0 +1,3 @@ +Bugsnag.configure do |config| + config.api_key = ENV["BUGSNAG_API_TOKEN"] +end diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 00000000..ac5f8b66 --- /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 = :marshal diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index a3d2cd66..c5e0b80f 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -5,7 +5,7 @@ # random tokens. Changing this key will render invalid all existing # confirmation, reset password and unlock tokens in the database. - config.secret_key = ENV['DEVISE_SECRET_KEY'] + config.secret_key = ENV["DEVISE_SECRET_KEY"] if Rails.env == "production" || Rails.env == "test" # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 72aca7e4..dc189968 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -2,4 +2,3 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 5e3cbe62..adba3f3a 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -SaferstallsRails::Application.config.session_store :cookie_store, key: '_saferstalls_rails_session' +Rails.application.config.session_store :cookie_store, key: "_saferstalls_rails_session" diff --git a/config/routes.rb b/config/routes.rb index 92505681..d573ac24 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,8 +1,7 @@ -SaferstallsRails::Application.routes.draw do +Rails.application.routes.draw do devise_for :admin_users, ActiveAdmin::Devise.config ActiveAdmin.routes(self) resources :restrooms - mount API::Base => '/api' get '/about', to: 'welcome#about' diff --git a/features/guess.feature b/features/guess.feature deleted file mode 100644 index adfe44b3..00000000 --- a/features/guess.feature +++ /dev/null @@ -1,15 +0,0 @@ -@javascript -Feature: Guess location - Scenario: Guess in Oakland - When I am in Oakland and I guess my location on the submission page - Then I should see that I am at 1400 Broadway - And I should see that I am in Oakland, California, United States - - Scenario: Guess from Canada - When I am in Winnipeg and I guess my location on the submission page - Then I should see that I am at 93 Albert Street - And I should see that I am in Winnipeg, Manitoba, Canada - - When I am in Vancouver and I guess my location on the submission page - Then I should see that I am at 678 East Hastings Street - And I should see that I am in Vancouver, British Columbia, Canada diff --git a/features/guess.feature.back b/features/guess.feature.back new file mode 100644 index 00000000..82d254a6 --- /dev/null +++ b/features/guess.feature.back @@ -0,0 +1,11 @@ +@javascript +Feature: Guess location + Scenario: Guess in Oakland + When I am in Oakland and I guess my location on the submission page + Then I should see that I am at 1400 Broadway + And I should see that I am in Oakland, California, US + + Scenario: Guess from Canada + When I am in Winnipeg and I guess my location on the submission page + Then I should see that I am at 93 Albert Street + And I should see that I am in Winnipeg, Manitoba, CA diff --git a/spec/api/v1/restrooms_spec.rb b/spec/api/v1/restrooms_spec.rb index 80b82ceb..a7d9e64a 100644 --- a/spec/api/v1/restrooms_spec.rb +++ b/spec/api/v1/restrooms_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Restrooms API' do +describe "Restrooms API", type: :request do it 'sends a list of restrooms order by date descending' do FactoryGirl.create_list(:restroom, 15) diff --git a/spec/controllers/restrooms_controller_spec.rb b/spec/controllers/restrooms_controller_spec.rb index 4bdad8f4..f96ad8d1 100644 --- a/spec/controllers/restrooms_controller_spec.rb +++ b/spec/controllers/restrooms_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe RestroomsController do +describe RestroomsController, type: :controller do it "should get index" do get :index expect(response).to be_success diff --git a/spec/controllers/welcome_controller_spec.rb b/spec/controllers/welcome_controller_spec.rb index 02836794..994eb778 100644 --- a/spec/controllers/welcome_controller_spec.rb +++ b/spec/controllers/welcome_controller_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe WelcomeController do +describe WelcomeController, type: :controller do it "should get index" do get :index expect(response).to be_success