Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test rails 32

  • Loading branch information...
commit c11974b8cd8040cd8ffc3ccdac820314b8d34124 1 parent ec22742
Daniel Kirsch authored
Showing with 700 additions and 0 deletions.
  1. +5 −0 test/rails32/.gitignore
  2. +34 −0 test/rails32/Gemfile
  3. +162 −0 test/rails32/Gemfile.lock
  4. +7 −0 test/rails32/Rakefile
  5. BIN  test/rails32/app/assets/images/rails.png
  6. +10 −0 test/rails32/app/assets/javascripts/application.js
  7. +7 −0 test/rails32/app/assets/stylesheets/application.css
  8. +3 −0  test/rails32/app/controllers/application_controller.rb
  9. +18 −0 test/rails32/app/controllers/flash_controller.rb
  10. +1 −0  test/rails32/app/views/flash/ajax.js.erb
  11. +13 −0 test/rails32/app/views/flash/show.html.erb
  12. +14 −0 test/rails32/app/views/layouts/application.html.erb
  13. +4 −0 test/rails32/config.ru
  14. +51 −0 test/rails32/config/application.rb
  15. +6 −0 test/rails32/config/boot.rb
  16. +5 −0 test/rails32/config/environment.rb
  17. +30 −0 test/rails32/config/environments/development.rb
  18. +60 −0 test/rails32/config/environments/production.rb
  19. +42 −0 test/rails32/config/environments/test.rb
  20. +7 −0 test/rails32/config/initializers/backtrace_silencers.rb
  21. +10 −0 test/rails32/config/initializers/inflections.rb
  22. +5 −0 test/rails32/config/initializers/mime_types.rb
  23. +7 −0 test/rails32/config/initializers/secret_token.rb
  24. +8 −0 test/rails32/config/initializers/session_store.rb
  25. +10 −0 test/rails32/config/initializers/wrap_parameters.rb
  26. +5 −0 test/rails32/config/locales/en.yml
  27. +6 −0 test/rails32/config/routes.rb
  28. 0  test/rails32/log/.gitkeep
  29. +26 −0 test/rails32/public/404.html
  30. +26 −0 test/rails32/public/422.html
  31. +26 −0 test/rails32/public/500.html
  32. 0  test/rails32/public/favicon.ico
  33. +5 −0 test/rails32/public/robots.txt
  34. +6 −0 test/rails32/script/rails
  35. BIN  test/rails32/spec/controllers/.flash_controller_spec.rb.swn
  36. BIN  test/rails32/spec/controllers/.flash_controller_spec.rb.swo
  37. +33 −0 test/rails32/spec/controllers/flash_controller_spec.rb
  38. +17 −0 test/rails32/spec/integration/flash_spec.rb
  39. +31 −0 test/rails32/spec/spec_helper.rb
View
5 test/rails32/.gitignore
@@ -0,0 +1,5 @@
+.bundle
+db/*.sqlite3
+log/*.log
+tmp/
+.sass-cache/
View
34 test/rails32/Gemfile
@@ -0,0 +1,34 @@
+source 'http://rubygems.org'
+
+gem 'rails', '~> 3.2.0'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'sass-rails', " ~> 3.2.0"
+ gem 'coffee-rails', "~> 3.2.0"
+ gem 'uglifier'
+end
+
+gem 'glow', path: '../..'
+
+gem 'jquery-rails'
+gem 'rspec-rails'
+gem 'capybara'
+gem 'htmlentities'
+gem 'capybara-webkit'
+
+# Use unicorn as the web server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
+
View
162 test/rails32/Gemfile.lock
@@ -0,0 +1,162 @@
+PATH
+ remote: ../..
+ specs:
+ glow (0.0.9)
+ jquery-rails
+ rails (>= 3.0.0, < 4.0.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.2.3)
+ actionpack (= 3.2.3)
+ mail (~> 2.4.4)
+ actionpack (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ activerecord (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ activesupport (3.2.3)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ addressable (2.2.7)
+ arel (3.0.2)
+ builder (3.0.0)
+ capybara (1.1.2)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 2.0)
+ xpath (~> 0.1.4)
+ capybara-webkit (0.11.0)
+ capybara (>= 1.0.0, < 1.2)
+ json
+ childprocess (0.3.1)
+ ffi (~> 1.0.6)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.3.1)
+ diff-lcs (1.1.3)
+ erubis (2.7.0)
+ execjs (1.3.0)
+ multi_json (~> 1.0)
+ ffi (1.0.11)
+ hike (1.2.1)
+ htmlentities (4.3.1)
+ i18n (0.6.0)
+ journey (1.0.3)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
+ thor (~> 0.14)
+ json (1.6.6)
+ libwebsocket (0.1.3)
+ addressable
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.18)
+ multi_json (1.3.0)
+ nokogiri (1.5.2)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.3)
+ actionmailer (= 3.2.3)
+ actionpack (= 3.2.3)
+ activerecord (= 3.2.3)
+ activeresource (= 3.2.3)
+ activesupport (= 3.2.3)
+ bundler (~> 1.0)
+ railties (= 3.2.3)
+ railties (3.2.3)
+ actionpack (= 3.2.3)
+ activesupport (= 3.2.3)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ rspec (2.9.0)
+ rspec-core (~> 2.9.0)
+ rspec-expectations (~> 2.9.0)
+ rspec-mocks (~> 2.9.0)
+ rspec-core (2.9.0)
+ rspec-expectations (2.9.1)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.9.0)
+ rspec-rails (2.9.0)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec (~> 2.9.0)
+ rubyzip (0.9.7)
+ sass (3.1.15)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ selenium-webdriver (2.21.0)
+ childprocess (>= 0.2.5)
+ ffi (~> 1.0)
+ libwebsocket (~> 0.1.3)
+ multi_json (~> 1.0)
+ rubyzip
+ sprockets (2.1.2)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.33)
+ uglifier (1.2.4)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ capybara
+ capybara-webkit
+ coffee-rails (~> 3.2.0)
+ glow!
+ htmlentities
+ jquery-rails
+ rails (~> 3.2.0)
+ rspec-rails
+ sass-rails (~> 3.2.0)
+ uglifier
View
7 test/rails32/Rakefile
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Rails31::Application.load_tasks
View
BIN  test/rails32/app/assets/images/rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 test/rails32/app/assets/javascripts/application.js
@@ -0,0 +1,10 @@
+// This is a manifest file that'll be compiled into including all the files listed below.
+// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
+// be included in the compiled file accessible from http://example.com/assets/application.js
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+//= require jquery
+//= require jquery_ujs
+//= require glow
+//= require_tree .
View
7 test/rails32/app/assets/stylesheets/application.css
@@ -0,0 +1,7 @@
+/*
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require_self
+ *= require_tree .
+*/
View
3  test/rails32/app/controllers/application_controller.rb
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
View
18 test/rails32/app/controllers/flash_controller.rb
@@ -0,0 +1,18 @@
+class FlashController < ApplicationController
+ def show
+ # show.html.erb
+ end
+
+ def redirect
+ flash[params[:type].to_sym] = params[:message]
+ redirect_to action: 'show'
+ end
+
+ def ajax
+ respond_to do |wants|
+ wants.js {
+ flash[params[:type].to_sym] = params[:message]
+ }
+ end
+ end
+end
View
1  test/rails32/app/views/flash/ajax.js.erb
@@ -0,0 +1 @@
+console.log('ajax response');
View
13 test/rails32/app/views/flash/show.html.erb
@@ -0,0 +1,13 @@
+<script type="application/javascript">
+ // Flash handling
+ $(document).bind('glow:flash', function(evt, flash) { console.log('glow flash'); $('#flash').html(flash.message); });
+</script>
+
+<p id="flash"><%= flash.map { |type, message| message }.join %></p>
+<p><%= link_to 'redirect', action: :redirect, type: :notice, message: 'utf8: ✓ ' %></p>
+<p><%= link_to 'rails ajax', {action: :ajax, type: :notice, message: 'rails ajax: ✓ '}, remote: true %></p>
+<p><%= link_to 'jquery ajax', '#', id: 'ajax' %></p>
+
+<script type="application/javascript">
+ $('#ajax').click(function(){$.get('<%= url_for action: :ajax, type: :notice, message: 'jquery utf8: ✓', format: :js %>'); return false;});
+</script>
View
14 test/rails32/app/views/layouts/application.html.erb
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Rails31</title>
+ <%= stylesheet_link_tag "application" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
View
4 test/rails32/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 Rails31::Application
View
51 test/rails32/config/application.rb
@@ -0,0 +1,51 @@
+require File.expand_path('../boot', __FILE__)
+
+require "action_controller/railtie"
+require "action_mailer/railtie"
+require "active_resource/railtie"
+require "sprockets/railtie"
+
+if defined?(Bundler)
+ # If you precompile assets before deploying to production, use this line
+ Bundler.require *Rails.groups(:assets => %w(development test))
+ # If you want your assets lazily compiled in production, use this line
+ # Bundler.require(:default, :assets, Rails.env)
+end
+
+module Rails31
+ 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 = true
+
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
+ end
+end
View
6 test/rails32/config/boot.rb
@@ -0,0 +1,6 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
View
5 test/rails32/config/environment.rb
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+Rails31::Application.initialize!
View
30 test/rails32/config/environments/development.rb
@@ -0,0 +1,30 @@
+Rails31::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
+
+ # 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
+
+ # 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 = true
+end
View
60 test/rails32/config/environments/production.rb
@@ -0,0 +1,60 @@
+Rails31::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
+
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Disable Rails's static asset server (Apache or nginx will already do this)
+ config.serve_static_assets = false
+
+ # Compress JavaScripts and CSS
+ config.assets.compress = true
+
+ # Don't fallback to assets pipeline if a precompiled asset is missed
+ config.assets.compile = false
+
+ # Generate digests for assets URLs
+ config.assets.digest = true
+
+ # Defaults to Rails.root.join("public/assets")
+ # config.assets.manifest = YOUR_PATH
+
+ # 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
+
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
+
+ # Use a different logger for distributed setups
+ # config.logger = 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"
+
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
+ # config.assets.precompile += %w( search.js )
+
+ # Disable delivery errors, bad email addresses will be ignored
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners
+ config.active_support.deprecation = :notify
+end
View
42 test/rails32/config/environments/test.rb
@@ -0,0 +1,42 @@
+Rails31::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 = true
+ 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
+
+ # 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
+
+ # 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 = true
+end
View
7 test/rails32/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/rails32/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/rails32/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/rails32/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.
+Rails31::Application.config.secret_token = '011674f911be1c903e62ab0017799eee12f628b81403e2aab25a7feda2f551dcc743fb37804a36ee4105e66c51b3adedd7eee0666287c6b6b01cd96a4b58881c'
View
8 test/rails32/config/initializers/session_store.rb
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+Rails31::Application.config.session_store :cookie_store, key: '_rails31_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")
+# Rails31::Application.config.session_store :active_record_store
View
10 test/rails32/config/initializers/wrap_parameters.rb
@@ -0,0 +1,10 @@
+# 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
+
View
5 test/rails32/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
6 test/rails32/config/routes.rb
@@ -0,0 +1,6 @@
+Rails31::Application.routes.draw do
+ match '/flash/:type' => 'flash#redirect', via: [:get, :post]
+ match '/flash' => 'flash#show'
+ match '/flashajax/:type' => 'flash#ajax', via: [:get, :post]
+ root to: 'flash#show'
+end
View
0  test/rails32/log/.gitkeep
No changes.
View
26 test/rails32/public/404.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The page you were looking for doesn't exist (404)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/404.html -->
+ <div class="dialog">
+ <h1>The page you were looking for doesn't exist.</h1>
+ <p>You may have mistyped the address or the page may have moved.</p>
+ </div>
+</body>
+</html>
View
26 test/rails32/public/422.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The change you wanted was rejected (422)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/422.html -->
+ <div class="dialog">
+ <h1>The change you wanted was rejected.</h1>
+ <p>Maybe you tried to change something you didn't have access to.</p>
+ </div>
+</body>
+</html>
View
26 test/rails32/public/500.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>We're sorry, but something went wrong (500)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/500.html -->
+ <div class="dialog">
+ <h1>We're sorry, but something went wrong.</h1>
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
+ </div>
+</body>
+</html>
View
0  test/rails32/public/favicon.ico
No changes.
View
5 test/rails32/public/robots.txt
@@ -0,0 +1,5 @@
+# See http://www.robotstxt.org/wc/norobots.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: /
View
6 test/rails32/script/rails
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
+
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require File.expand_path('../../config/boot', __FILE__)
+require 'rails/commands'
View
BIN  test/rails32/spec/controllers/.flash_controller_spec.rb.swn
Binary file not shown
View
BIN  test/rails32/spec/controllers/.flash_controller_spec.rb.swo
Binary file not shown
View
33 test/rails32/spec/controllers/flash_controller_spec.rb
@@ -0,0 +1,33 @@
+# encoding: utf-8
+require 'spec_helper'
+require 'htmlentities'
+
+ActionDispatch::Flash::FlashHash.class_eval do
+ def discard?(key); @used.include?(key); end
+ def keep?(key); !discard?(key); end
+end
+
+describe FlashController do
+ it "should display flash message on redirect" do
+ post :redirect, type: :notice, message: 'Glow!'
+
+ flash[:notice].should be == 'Glow!'
+ flash.keep?(:notice).should be true
+ end
+
+ it "should display flash message on xhr" do
+ xhr :get, :ajax, type: :notice, message: 'Glow!'
+
+ flash[:notice].should be == 'Glow!'
+ flash.discard?(:notice).should be true
+
+ @response.headers['X-Message-Type'].should be == 'notice'
+ HTMLEntities.new.decode(@response.headers['X-Message']).should be == 'Glow!'
+ end
+
+ it "should handle unicode on xhr" do
+ xhr :get, :ajax, type: :notice, message: 'utf8: ✓'
+ @response.headers['X-Message-Type'].should be == 'notice'
+ HTMLEntities.new.decode(@response.headers['X-Message']).should be == 'utf8: ✓'
+ end
+end
View
17 test/rails32/spec/integration/flash_spec.rb
@@ -0,0 +1,17 @@
+# encoding: utf-8
+require 'spec_helper'
+
+describe "the flash view" do
+ it "redirects" do
+ visit root_path
+ click_on 'redirect'
+ page.has_content?('utf8: ✓')
+ end
+
+ it "handles ajax" do
+ visit root_path
+ click_on 'ajax'
+ page.has_content?('ajax: ✓')
+ end
+end
+
View
31 test/rails32/spec/spec_helper.rb
@@ -0,0 +1,31 @@
+# This file is copied to spec/ when you run 'rails generate rspec:install'
+ENV["RAILS_ENV"] ||= 'test'
+require File.expand_path("../../config/environment", __FILE__)
+require 'rspec/rails'
+require 'capybara/rspec'
+require 'capybara/rails'
+
+Capybara.default_driver = :webkit
+
+# Requires supporting ruby files with custom matchers and macros, etc,
+# in spec/support/ and its subdirectories.
+Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+
+RSpec.configure do |config|
+ # == Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+ config.mock_with :rspec
+
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
+ #config.fixture_path = "#{::Rails.root}/spec/fixtures"
+
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
+ # examples within a transaction, remove the following line or assign false
+ # instead of true.
+ #config.use_transactional_fixtures = true
+end
Please sign in to comment.
Something went wrong with that request. Please try again.