Permalink
Browse files

Test rails 32

  • Loading branch information...
Daniel Kirsch
Daniel Kirsch committed Apr 16, 2012
1 parent ec22742 commit c11974b8cd8040cd8ffc3ccdac820314b8d34124
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
@@ -0,0 +1,5 @@
+.bundle
+db/*.sqlite3
+log/*.log
+tmp/
+.sass-cache/
View
@@ -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
@@ -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
@@ -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
Binary file not shown.
@@ -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 .
@@ -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 .
+*/
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
@@ -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
@@ -0,0 +1 @@
+console.log('ajax response');
@@ -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>
@@ -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
@@ -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
@@ -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
@@ -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'])
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+Rails31::Application.initialize!
@@ -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
Oops, something went wrong.

0 comments on commit c11974b

Please sign in to comment.