Permalink
Browse files

Rails 3.1 base

  • Loading branch information...
mattheworiordan committed Nov 7, 2011
0 parents commit d8288c863df4118a4329dece971d7c6269cad939
Showing with 10,099 additions and 0 deletions.
  1. +22 −0 Gemfile
  2. +152 −0 Gemfile.lock
  3. +19 −0 LICENSE
  4. +20 −0 README.md
  5. +7 −0 Rakefile
  6. +3 −0 app/controllers/application_controller.rb
  7. +2 −0 app/controllers/welcome_controller.rb
  8. +2 −0 app/helpers/application_helper.rb
  9. +12 −0 app/views/layouts/application.html.erb
  10. +3 −0 app/views/welcome/index.html.erb
  11. +1 −0 app/views/welcome/rack.html.erb
  12. +4 −0 app/views/welcome/selenium.html.erb
  13. +4 −0 app/views/welcome/webkit.html.erb
  14. +4 −0 config.ru
  15. +48 −0 config/application.rb
  16. +6 −0 config/boot.rb
  17. +8 −0 config/cucumber.yml
  18. +25 −0 config/database.yml
  19. +5 −0 config/environment.rb
  20. +30 −0 config/environments/development.rb
  21. +60 −0 config/environments/production.rb
  22. +39 −0 config/environments/test.rb
  23. +7 −0 config/initializers/backtrace_silencers.rb
  24. +10 −0 config/initializers/inflections.rb
  25. +5 −0 config/initializers/mime_types.rb
  26. +7 −0 config/initializers/secret_token.rb
  27. +8 −0 config/initializers/session_store.rb
  28. +14 −0 config/initializers/wrap_parameters.rb
  29. +5 −0 config/locales/en.yml
  30. +6 −0 config/routes.rb
  31. BIN db/development.sqlite3
  32. +15 −0 db/schema.rb
  33. +7 −0 db/seeds.rb
  34. BIN db/test.sqlite3
  35. +2 −0 doc/README_FOR_APP
  36. +21 −0 features/basic.feature
  37. +19 −0 features/step_definitions/web_steps.rb
  38. +28 −0 features/support/env.rb
  39. +27 −0 features/support/paths.rb
  40. 0 lib/tasks/.gitkeep
  41. +65 −0 lib/tasks/cucumber.rake
  42. +26 −0 public/404.html
  43. +26 −0 public/422.html
  44. +26 −0 public/500.html
  45. 0 public/favicon.ico
  46. BIN public/images/rails.png
  47. +2 −0 public/javascripts/application.js
  48. +965 −0 public/javascripts/controls.js
  49. +974 −0 public/javascripts/dragdrop.js
  50. +1,123 −0 public/javascripts/effects.js
  51. +6,001 −0 public/javascripts/prototype.js
  52. +191 −0 public/javascripts/rails.js
  53. +5 −0 public/robots.txt
  54. 0 public/stylesheets/.gitkeep
  55. +10 −0 script/cucumber
  56. +6 −0 script/rails
  57. +9 −0 test/performance/browsing_test.rb
  58. +13 −0 test/test_helper.rb
  59. 0 vendor/plugins/.gitkeep
22 Gemfile
@@ -0,0 +1,22 @@
+source 'http://rubygems.org'
+
+gem 'rails', '~>3.1'
+
+gem 'sqlite3'
+
+group :test do
+ gem 'cucumber'
+ gem 'cucumber-rails'
+ gem 'capybara'
+ gem 'capybara-webkit'
+ gem 'capybara-screenshot', '~>0.1'
+ gem 'rspec'
+end
+
+group :development, :test do
+ if RUBY_VERSION =~ /^1\.8\.[\d]+$/
+ gem 'ruby-debug'
+ else
+ gem 'ruby-debug19'
+ end
+end
@@ -0,0 +1,152 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.1.1)
+ actionpack (= 3.1.1)
+ mail (~> 2.3.0)
+ actionpack (3.1.1)
+ activemodel (= 3.1.1)
+ activesupport (= 3.1.1)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ i18n (~> 0.6)
+ rack (~> 1.3.2)
+ rack-cache (~> 1.1)
+ rack-mount (~> 0.8.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.0.2)
+ activemodel (3.1.1)
+ activesupport (= 3.1.1)
+ builder (~> 3.0.0)
+ i18n (~> 0.6)
+ activerecord (3.1.1)
+ activemodel (= 3.1.1)
+ activesupport (= 3.1.1)
+ arel (~> 2.2.1)
+ tzinfo (~> 0.3.29)
+ activeresource (3.1.1)
+ activemodel (= 3.1.1)
+ activesupport (= 3.1.1)
+ activesupport (3.1.1)
+ multi_json (~> 1.0)
+ arel (2.2.1)
+ builder (3.0.0)
+ capybara (1.1.1)
+ 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-screenshot (0.1.0)
+ capybara (>= 1.0)
+ cucumber (>= 1.0)
+ capybara-webkit (0.7.2)
+ capybara (>= 1.0.0, < 1.2)
+ childprocess (0.2.2)
+ ffi (~> 1.0.6)
+ columnize (0.3.4)
+ cucumber (1.1.1)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.2)
+ gherkin (~> 2.6.0)
+ json (>= 1.4.6)
+ term-ansicolor (>= 1.0.6)
+ cucumber-rails (1.2.0)
+ capybara (>= 1.1.1)
+ cucumber (>= 1.1.1)
+ nokogiri (>= 1.5.0)
+ diff-lcs (1.1.3)
+ erubis (2.7.0)
+ ffi (1.0.9)
+ gherkin (2.6.2)
+ json (>= 1.4.6)
+ hike (1.2.1)
+ i18n (0.6.0)
+ json (1.6.1)
+ json_pure (1.6.1)
+ linecache (0.46)
+ rbx-require-relative (> 0.0.4)
+ mail (2.3.0)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.17.2)
+ multi_json (1.0.3)
+ nokogiri (1.5.0)
+ polyglot (0.3.3)
+ rack (1.3.5)
+ rack-cache (1.1)
+ rack (>= 0.4)
+ rack-mount (0.8.3)
+ rack (>= 1.0.0)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.1.1)
+ actionmailer (= 3.1.1)
+ actionpack (= 3.1.1)
+ activerecord (= 3.1.1)
+ activeresource (= 3.1.1)
+ activesupport (= 3.1.1)
+ bundler (~> 1.0)
+ railties (= 3.1.1)
+ railties (3.1.1)
+ actionpack (= 3.1.1)
+ activesupport (= 3.1.1)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2.2)
+ rbx-require-relative (0.0.5)
+ rdoc (3.11)
+ json (~> 1.4)
+ rspec (2.7.0)
+ rspec-core (~> 2.7.0)
+ rspec-expectations (~> 2.7.0)
+ rspec-mocks (~> 2.7.0)
+ rspec-core (2.7.1)
+ rspec-expectations (2.7.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.7.0)
+ ruby-debug (0.10.4)
+ columnize (>= 0.1)
+ ruby-debug-base (~> 0.10.4.0)
+ ruby-debug-base (0.10.4)
+ linecache (>= 0.3)
+ rubyzip (0.9.4)
+ selenium-webdriver (2.10.0)
+ childprocess (>= 0.2.1)
+ ffi (= 1.0.9)
+ json_pure
+ rubyzip
+ sprockets (2.0.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.4)
+ term-ansicolor (1.0.7)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.31)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ capybara
+ capybara-screenshot (~> 0.1)
+ capybara-webkit
+ cucumber
+ cucumber-rails
+ rails (~> 3.1)
+ rspec
+ ruby-debug
+ sqlite3
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Matthew O'Riordan, inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
@@ -0,0 +1,20 @@
+capybara-screenshot gem sample test application
+===============================================
+
+This is a simple rails application which demonstrates using the [capybara-screenshot gem](https://github.com/mattheworiordan/capybara-screenshot).
+
+Run the cucumber tests `bundle exec cucumber` to test the Gem and generate source code and screen shots (when using [capybara-webkit](https://github.com/thoughtbot/capybara-webkit)) from failing scenarios into /tmp/capybara.
+
+About
+-----
+
+This test application was written by **Matthew O'Riordan**
+
+ - [http://mattheworiordan.com](http://mattheworiordan.com)
+ - [@mattheworiordan](http://twitter.com/#!/mattheworiordan)
+ - [Linked In](http://www.linkedin.com/in/lemon)
+
+License
+-------
+
+Copyright © 2011 Matthew O'Riordan, inc. It is free software, and may be redistributed under the terms specified in the LICENSE file.
@@ -0,0 +1,7 @@
+# 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__)
+require 'rake'
+
+CapybaraScreenshotTest::Application.load_tasks
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
@@ -0,0 +1,2 @@
+class WelcomeController < ApplicationController
+end
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CapybaraScreenshotTest</title>
+ <%= csrf_meta_tag %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
@@ -0,0 +1,3 @@
+<h1>Cucumber test</h1>
+
+Run the cucumber tests `bundle exec cucumber` to test the Gem and generate source code and screen shots (when using capybara-webkit) from failing scenarios into /tmp/capybara.
@@ -0,0 +1 @@
+<h1>Rack</h1>
@@ -0,0 +1,4 @@
+<h1 id="title">Selenium</h1>
+<script language="javascript">
+ document.getElementById('title').innerHTML += ' supports Javascript';
+</script>
@@ -0,0 +1,4 @@
+<h1 id="title">Webkit</h1>
+<script language="javascript">
+ document.getElementById('title').innerHTML += ' supports Javascript';
+</script>
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run CapybaraScreenshotTest::Application
@@ -0,0 +1,48 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+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 CapybaraScreenshotTest
+ 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,8 @@
+<%
+rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
+rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
+std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
+%>
+default: <%= std_opts %> features
+wip: --tags @wip:3 --wip features
+rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
@@ -0,0 +1,25 @@
+# SQLite version 3.x
+# gem install sqlite3
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test: &test
+ adapter: sqlite3
+ database: db/test.sqlite3
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
+
+cucumber:
+ <<: *test
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+CapybaraScreenshotTest::Application.initialize!
Oops, something went wrong.

0 comments on commit d8288c8

Please sign in to comment.