From 221be6d6efc80f6c58d5ab13cf5898fa1e5e877f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 13 Nov 2013 13:29:25 +0100 Subject: [PATCH] Update bundled rails app --- test/rails_app/config/boot.rb | 8 +++- .../config/environments/development.rb | 4 -- .../config/environments/production.rb | 4 -- test/rails_app/db/schema.rb | 38 ++++++++++--------- test/test_helper.rb | 7 ---- 5 files changed, 28 insertions(+), 33 deletions(-) diff --git a/test/rails_app/config/boot.rb b/test/rails_app/config/boot.rb index d0ab1394..1a479a1a 100644 --- a/test/rails_app/config/boot.rb +++ b/test/rails_app/config/boot.rb @@ -2,7 +2,13 @@ unless defined?(DEVISE_ORM) DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym end +module Devise + # Detection for minor differences between Rails 3.2 and 4 in tests. + def self.rails4? + Rails.version.start_with? '4' + end +end + # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) - require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) diff --git a/test/rails_app/config/environments/development.rb b/test/rails_app/config/environments/development.rb index f7cea6d5..fcddb5f5 100644 --- a/test/rails_app/config/environments/development.rb +++ b/test/rails_app/config/environments/development.rb @@ -22,10 +22,6 @@ RailsApp::Application.configure do # Only use best-standards-support built into browsers. config.action_dispatch.best_standards_support = :builtin - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL). - config.active_record.auto_explain_threshold_in_seconds = 0.5 - # Raise an error on page load if there are pending migrations config.active_record.migration_error = :page_load diff --git a/test/rails_app/config/environments/production.rb b/test/rails_app/config/environments/production.rb index 79c54188..2ce2f518 100644 --- a/test/rails_app/config/environments/production.rb +++ b/test/rails_app/config/environments/production.rb @@ -72,10 +72,6 @@ RailsApp::Application.configure do # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL). - # config.active_record.auto_explain_threshold_in_seconds = 0.5 - # Disable automatic flushing of the log to improve performance. # config.autoflush_log = false diff --git a/test/rails_app/db/schema.rb b/test/rails_app/db/schema.rb index c36bc6fb..a7446056 100644 --- a/test/rails_app/db/schema.rb +++ b/test/rails_app/db/schema.rb @@ -1,3 +1,4 @@ +# 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. @@ -8,40 +9,43 @@ # 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 to check this file into your version control system. +# It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(:version => 20100401102949) do +ActiveRecord::Schema.define(version: 20100401102949) do - create_table "admins", :force => true do |t| + create_table "admins", force: true do |t| t.string "email" - t.string "encrypted_password", :limit => 128 - t.string "password_salt" - t.string "remember_token" - t.datetime "remember_created_at" + t.string "encrypted_password" t.string "reset_password_token" - t.integer "failed_attempts", :default => 0 - t.string "unlock_token" + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.string "confirmation_token" + t.datetime "confirmed_at" + t.datetime "confirmation_sent_at" + t.string "unconfirmed_email" t.datetime "locked_at" + t.boolean "active", default: false t.datetime "created_at" t.datetime "updated_at" end - create_table "users", :force => true do |t| + create_table "users", force: true do |t| t.string "username" t.string "facebook_token" - t.string "email", :default => "", :null => false - t.string "encrypted_password", :limit => 128, :default => "", :null => false - t.string "confirmation_token" - t.datetime "confirmed_at" - t.datetime "confirmation_sent_at" + t.string "email", default: "", null: false + t.string "encrypted_password", default: "", null: false t.string "reset_password_token" + t.datetime "reset_password_sent_at" t.datetime "remember_created_at" - t.integer "sign_in_count", :default => 0 + t.integer "sign_in_count", default: 0 t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip" t.string "last_sign_in_ip" - t.integer "failed_attempts", :default => 0 + t.string "confirmation_token" + t.datetime "confirmed_at" + t.datetime "confirmation_sent_at" + t.integer "failed_attempts", default: 0 t.string "unlock_token" t.datetime "locked_at" t.datetime "created_at" diff --git a/test/test_helper.rb b/test/test_helper.rb index 1548e93a..60420446 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,13 +4,6 @@ DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym $:.unshift File.dirname(__FILE__) puts "\n==> Devise.orm = #{DEVISE_ORM.inspect}" -module Devise - # Detection for minor differences between Rails 3.2 and 4 in tests. - def self.rails4? - Rails.version.start_with? '4' - end -end - require "rails_app/config/environment" require "rails/test_help" require "orm/#{DEVISE_ORM}"