Browse files

Updated test Rails environment to 3.13.

Signed-off-by: James McCarthy <james2mccarthy@gmail.com>
  • Loading branch information...
1 parent a910084 commit 3f5f3a342a96e5fb862b6c683ad2ccf93168037b @james2m committed Nov 28, 2011
Showing with 216 additions and 262 deletions.
  1. +3 −0 test/dummy/app/controllers/application_controller.rb
  2. +2 −0 test/dummy/app/helpers/application_helper.rb
  3. 0 test/{rails_root/config/environments/test.rb → dummy/app/models/.gitkeep}
  4. +1 −0 test/{rails_root → dummy}/app/models/user.rb
  5. 0 test/{rails_root → dummy}/app/models/user_session.rb
  6. +14 −0 test/dummy/app/views/layouts/application.html.erb
  7. +4 −0 test/dummy/config.ru
  8. +49 −0 test/dummy/config/application.rb
  9. +10 −0 test/dummy/config/boot.rb
  10. +6 −0 test/dummy/config/database.yml
  11. +5 −0 test/dummy/config/environment.rb
  12. +27 −0 test/dummy/config/environments/development.rb
  13. +37 −0 test/dummy/config/environments/test.rb
  14. 0 test/{rails_root → dummy}/config/facebook.yml
  15. +7 −0 test/dummy/config/initializers/backtrace_silencers.rb
  16. +10 −0 test/dummy/config/initializers/inflections.rb
  17. +5 −0 test/dummy/config/initializers/mime_types.rb
  18. +7 −0 test/dummy/config/initializers/secret_token.rb
  19. +8 −0 test/dummy/config/initializers/session_store.rb
  20. +14 −0 test/dummy/config/initializers/wrap_parameters.rb
  21. +5 −0 test/dummy/config/locales/en.yml
  22. +2 −0 test/dummy/config/routes.rb
  23. 0 test/{rails_root → dummy}/db/migrate/20101217000008_create_users.rb
  24. 0 test/{rails_root → dummy}/db/seeds.rb
  25. +0 −10 test/rails_root/app/controllers/application_controller.rb
  26. +0 −3 test/rails_root/app/helpers/application_helper.rb
  27. +0 −110 test/rails_root/config/boot.rb
  28. +0 −10 test/rails_root/config/database.yml
  29. +0 −31 test/rails_root/config/environment.rb
  30. 0 test/rails_root/config/environments/development.rb
  31. +0 −5 test/rails_root/config/initializers/authlogic_facebook_koala.rb
  32. +0 −21 test/rails_root/config/initializers/new_rails_defaults.rb
  33. +0 −15 test/rails_root/config/initializers/session_store.rb
  34. +0 −5 test/rails_root/config/locales/en.yml
  35. +0 −43 test/rails_root/config/routes.rb
  36. +0 −3 test/rails_root/script/console
  37. +0 −3 test/rails_root/script/dbconsole
  38. +0 −3 test/rails_root/script/generate
View
3 test/dummy/app/controllers/application_controller.rb
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
View
2 test/dummy/app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
View
0 test/rails_root/config/environments/test.rb → test/dummy/app/models/.gitkeep
File renamed without changes.
View
1 test/rails_root/app/models/user.rb → test/dummy/app/models/user.rb
@@ -4,4 +4,5 @@ class User < ActiveRecord::Base
def before_connect(facebook_session)
true
end
+
end
View
0 test/rails_root/app/models/user_session.rb → test/dummy/app/models/user_session.rb
File renamed without changes.
View
14 test/dummy/app/views/layouts/application.html.erb
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Dummy</title>
+ <%= stylesheet_link_tag "application" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
View
4 test/dummy/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 Dummy::Application
View
49 test/dummy/config/application.rb
@@ -0,0 +1,49 @@
+require File.expand_path('../boot', __FILE__)
+
+# Pick the frameworks you want:
+require "active_record/railtie"
+require "action_controller/railtie"
+require "rails/test_unit/railtie"
+
+Bundler.require
+require 'authlogic'
+require "authlogic_facebook_shim"
+
+module Dummy
+ 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.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ # config.autoload_paths += %W(#{config.root}/extras)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # 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
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+
+ # Enable the asset pipeline
+ config.assets.enabled = false
+
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
+ end
+end
+
View
10 test/dummy/config/boot.rb
@@ -0,0 +1,10 @@
+require 'rubygems'
+gemfile = File.expand_path('../../../../Gemfile', __FILE__)
+
+if File.exist?(gemfile)
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+end
+
+$:.unshift File.expand_path('../../../../lib', __FILE__)
View
6 test/dummy/config/database.yml
@@ -0,0 +1,6 @@
+test:
+ adapter: sqlite3
+ database: ':memory:'
+development:
+ adapter: sqlite3
+ database: ':memory:'
View
5 test/dummy/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+Dummy::Application.initialize!
View
27 test/dummy/config/environments/development.rb
@@ -0,0 +1,27 @@
+Dummy::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
+
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
+
+ # Print deprecation notices to the Rails logger
+ config.active_support.deprecation = :log
+
+ # Only use best-standards-support built into browsers
+ config.action_dispatch.best_standards_support = :builtin
+
+ # Do not compress assets
+ config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = false
+end
View
37 test/dummy/config/environments/test.rb
@@ -0,0 +1,37 @@
+Dummy::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
+
+ # Configure static asset server for tests with Cache-Control for performance
+ config.serve_static_assets = false
+ config.static_cache_control = "public, max-age=3600"
+
+ # Log error messages when you accidentally call methods on nil
+ config.whiny_nils = true
+
+ # 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
+
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Print deprecation notices to the stderr
+ config.active_support.deprecation = :stderr
+
+ # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets
+ config.assets.allow_debugging = false
+end
View
0 test/rails_root/config/facebook.yml → test/dummy/config/facebook.yml
File renamed without changes.
View
7 test/dummy/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!
View
10 test/dummy/config/initializers/inflections.rb
@@ -0,0 +1,10 @@
+# Be sure to restart your server when you modify this file.
+
+# Add new inflection rules using the following format
+# (all these examples are active by default):
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.plural /^(ox)$/i, '\1en'
+# inflect.singular /^(ox)en/i, '\1'
+# inflect.irregular 'person', 'people'
+# inflect.uncountable %w( fish sheep )
+# end
View
5 test/dummy/config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# 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
+# Mime::Type.register_alias "text/html", :iphone
View
7 test/dummy/config/initializers/secret_token.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+# Your secret key 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.
+Dummy::Application.config.secret_token = '5ab1866fc84187a8ef685a7e0b6e55d1a616a3b767d4398cc6455d891e3079d991f5769f1ff2054ccf5ad8861e51871b9e3ef3c08654ccfb64a6cb6106a84d9a'
View
8 test/dummy/config/initializers/session_store.rb
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
+
+# Use the database for sessions instead of the cookie-based default,
+# which shouldn't be used to store highly confidential information
+# (create the session table with "rails generate session_migration")
+# Dummy::Application.config.session_store :active_record_store
View
14 test/dummy/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]
+end
+
+# Disable root element in JSON by default.
+ActiveSupport.on_load(:active_record) do
+ self.include_root_in_json = false
+end
View
5 test/dummy/config/locales/en.yml
@@ -0,0 +1,5 @@
+# Sample localization file for English. Add more files in this directory for other locales.
+# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+en:
+ hello: "Hello world"
View
2 test/dummy/config/routes.rb
@@ -0,0 +1,2 @@
+Dummy::Application.routes.draw do
+end
View
0 ...db/migrate/20101217000008_create_users.rb → ...db/migrate/20101217000008_create_users.rb
File renamed without changes.
View
0 test/rails_root/db/seeds.rb → test/dummy/db/seeds.rb
File renamed without changes.
View
10 test/rails_root/app/controllers/application_controller.rb
@@ -1,10 +0,0 @@
-# Filters added to this controller apply to all controllers in the application.
-# Likewise, all the methods added will be available for all controllers.
-
-class ApplicationController < ActionController::Base
- helper :all # include all helpers, all the time
- protect_from_forgery # See ActionController::RequestForgeryProtection for details
-
- # Scrub sensitive parameters from your log
- # filter_parameter_logging :password
-end
View
3 test/rails_root/app/helpers/application_helper.rb
@@ -1,3 +0,0 @@
-# Methods added to this helper will be available to all templates in the application.
-module ApplicationHelper
-end
View
110 test/rails_root/config/boot.rb
@@ -1,110 +0,0 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- Rails::GemDependency.add_frozen_gem_path
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion rescue nil
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- min_version = '1.3.2'
- require 'rubygems'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-# All that for this:
-Rails.boot!
View
10 test/rails_root/config/database.yml
@@ -1,10 +0,0 @@
-development:
- :adapter: sqlite3
- :database: ":memory:"
- pool: 5
- timeout: 5000
-test:
- :adapter: sqlite3
- :database: ":memory:"
- pool: 5
- timeout: 5000
View
31 test/rails_root/config/environment.rb
@@ -1,31 +0,0 @@
-RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
- # config.i18n.default_locale = :de
- # config.active_record.schema_format = :sql
-
- config.gem "authlogic"
- config.gem 'flexmock'
- config.gem "koala"
- config.gem "shoulda"
- config.gem "test-unit", :lib => "test/unit"
-
- config.frameworks -= [ :active_resource, :action_mailer ]
- config.log_level = :debug
- config.cache_classes = false
- config.whiny_nils = true
- config.action_controller.consider_all_requests_local = true
- config.action_controller.perform_caching = false
- config.action_view.cache_template_loading = true
- config.action_controller.allow_forgery_protection = false
- config.action_mailer.delivery_method = :test
- config.time_zone = 'UTC'
-
-end
View
0 test/rails_root/config/environments/development.rb
No changes.
View
5 test/rails_root/config/initializers/authlogic_facebook_koala.rb
@@ -1,5 +0,0 @@
-afk_path = File.join(File.dirname(__FILE__), *%w(.. .. .. ..))
-afk_lib_path = File.join(afk_path, "lib")
-
-$LOAD_PATH.unshift(afk_lib_path)
-load File.join(afk_path, "init.rb")
View
21 test/rails_root/config/initializers/new_rails_defaults.rb
@@ -1,21 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# These settings change the behavior of Rails 2 apps and will be defaults
-# for Rails 3. You can remove this initializer when Rails 3 is released.
-
-if defined?(ActiveRecord)
- # Include Active Record class name as root for JSON serialized output.
- ActiveRecord::Base.include_root_in_json = true
-
- # Store the full class name (including module namespace) in STI type column.
- ActiveRecord::Base.store_full_sti_class = true
-end
-
-ActionController::Routing.generate_best_match = false
-
-# Use ISO 8601 format for JSON serialized times and dates.
-ActiveSupport.use_standard_json_time_format = true
-
-# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
-# if you're including raw json in an HTML page.
-ActiveSupport.escape_html_entities_in_json = false
View
15 test/rails_root/config/initializers/session_store.rb
@@ -1,15 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Your secret key for verifying cookie session data integrity.
-# If you change this key, all old sessions 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.
-ActionController::Base.session = {
- :key => '_rails_root_session',
- :secret => '4deb5b6e05377d982fa6ef37582c0be6de39e1473cc99a4a0f32fd61ec735cd9e86276b2c25fc781e7df8cd6afdc819208f7f497a755e217bff75728d05f543b'
-}
-
-# Use the database for sessions instead of the cookie-based default,
-# which shouldn't be used to store highly confidential information
-# (create the session table with "rake db:sessions:create")
-# ActionController::Base.session_store = :active_record_store
View
5 test/rails_root/config/locales/en.yml
@@ -1,5 +0,0 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
-
-en:
- hello: "Hello world"
View
43 test/rails_root/config/routes.rb
@@ -1,43 +0,0 @@
-ActionController::Routing::Routes.draw do |map|
- # The priority is based upon order of creation: first created -> highest priority.
-
- # Sample of regular route:
- # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
- # Keep in mind you can assign values other than :controller and :action
-
- # Sample of named route:
- # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # map.resources :products
-
- # Sample resource route with options:
- # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
-
- # Sample resource route with sub-resources:
- # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
-
- # Sample resource route with more complex sub-resources
- # map.resources :products do |products|
- # products.resources :comments
- # products.resources :sales, :collection => { :recent => :get }
- # end
-
- # Sample resource route within a namespace:
- # map.namespace :admin do |admin|
- # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
- # admin.resources :products
- # end
-
- # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
- # map.root :controller => "welcome"
-
- # See how all your routes lay out with "rake routes"
-
- # Install the default routes as the lowest priority.
- # Note: These default routes make all actions in every controller accessible via GET requests. You should
- # consider removing or commenting them out if you're using named routes and resources.
- map.connect ':controller/:action/:id'
- map.connect ':controller/:action/:id.:format'
-end
View
3 test/rails_root/script/console
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.expand_path('../../config/boot', __FILE__)
-require 'commands/console'
View
3 test/rails_root/script/dbconsole
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.expand_path('../../config/boot', __FILE__)
-require 'commands/dbconsole'
View
3 test/rails_root/script/generate
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.expand_path('../../config/boot', __FILE__)
-require 'commands/generate'

0 comments on commit 3f5f3a3

Please sign in to comment.