Permalink
Browse files

update to Rails 3.2

  • Loading branch information...
1 parent 58afa04 commit 52fb0f694c4c098f71d196740e215e87af11d7b8 @DanielKehoe DanielKehoe committed Jan 29, 2012
Showing with 346 additions and 285 deletions.
  1. +9 −9 Gemfile
  2. +21 −25 README.textile
  3. +9 −3 app/assets/javascripts/application.js
  4. +0 −28 app/assets/stylesheets/application.css
  5. +35 −0 app/assets/stylesheets/application.css.scss
  6. +0 −1 app/controllers/users_controller.rb
  7. 0 app/views/devise/{shared → }/_links.erb
  8. +1 −1 app/views/devise/confirmations/new.html.erb
  9. +1 −1 app/views/devise/mailer/confirmation_instructions.html.erb
  10. +1 −1 app/views/devise/passwords/edit.html.erb
  11. +1 −1 app/views/devise/passwords/new.html.erb
  12. +1 −1 app/views/devise/registrations/new.html.erb
  13. +1 −1 app/views/devise/sessions/new.html.erb
  14. +1 −1 app/views/devise/unlocks/new.html.erb
  15. +2 −2 app/views/layouts/application.html.erb
  16. +14 −1 config/application.rb
  17. +8 −1 config/environments/development.rb
  18. +4 −1 config/environments/production.rb
  19. +4 −6 config/environments/test.rb
  20. +29 −16 config/initializers/devise.rb
  21. +5 −0 config/initializers/inflections.rb
  22. +5 −6 config/locales/devise.en.yml
  23. +1 −1 config/routes.rb
  24. +0 −28 db/migrate/20110423013547_devise_create_users.rb
  25. +49 −0 db/migrate/20120129231330_devise_create_users.rb
  26. +1 −4 db/migrate/{20110423013550_add_name_to_users.rb → 20120129231333_add_name_to_users.rb}
  27. +5 −5 db/schema.rb
  28. +102 −62 features/step_definitions/user_steps.rb
  29. +15 −22 features/users/sign_in.feature
  30. +4 −6 features/users/sign_out.feature
  31. +10 −37 features/users/sign_up.feature
  32. +3 −9 features/users/user_edit.feature
  33. +3 −3 features/users/user_show.feature
  34. +0 −1 public/500.html
  35. +1 −1 spec/spec_helper.rb
View
@@ -1,16 +1,16 @@
-source 'http://rubygems.org'
-gem 'rails', '3.1.3'
+source 'https://rubygems.org'
+gem 'rails', '3.2.0'
gem 'sqlite3'
group :assets do
- gem 'sass-rails', '~> 3.1.5'
- gem 'coffee-rails', '~> 3.1.1'
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
-gem "rspec-rails", ">= 2.8.0.rc1", :group => [:development, :test]
-gem "factory_girl_rails", ">= 1.4.0", :group => :test
-gem "cucumber-rails", ">= 1.2.0", :group => :test
+gem "rspec-rails", ">= 2.8.1", :group => [:development, :test]
+gem "factory_girl_rails", ">= 1.6.0", :group => :test
+gem "cucumber-rails", ">= 1.2.1", :group => :test
gem "capybara", ">= 1.1.2", :group => :test
-gem "database_cleaner", ">= 0.7.0", :group => :test
+gem "database_cleaner", ">= 0.7.1", :group => :test
gem "launchy", ">= 2.0.5", :group => :test
-gem "devise", ">= 1.5.0"
+gem "devise", ">= 2.0.0"
View
@@ -1,22 +1,20 @@
-h1. Rails 3.1 + Devise + RSpec + Cucumber
+h1. Rails 3.2 Devise RSpec Cucumber
-This is an example application for Rails 3.1.x that shows how to use "Devise":http://github.com/plataformatec/devise with "RSpec":http://rspec.info/ and "Cucumber":http://cukes.info/. Devise gives you ready-made authentication and user management. RSpec is a popular alternative to the Test::Unit testing framework. Cucumber is often used with RSpec for Behaviour Driven Development.
+This is an example application for Rails 3.2 that shows how to use "Devise":http://github.com/plataformatec/devise with "RSpec":http://rspec.info/ and "Cucumber":http://cukes.info/. Devise gives you ready-made authentication and user management. RSpec is a popular alternative to the Test::Unit testing framework. Cucumber is often used with RSpec for Behaviour Driven Development.
Best of all, there's a "detailed tutorial":https://github.com/RailsApps/rails3-devise-rspec-cucumber/wiki/Tutorial (walk-through) to show how it's built.
You can clone this app or generate a new Rails application using this app as a template.
Any issues? Please create a "GitHub issue":http://github.com/RailsApps/rails3-devise-rspec-cucumber/issues.
-h2. !http://twitter-badges.s3.amazonaws.com/t_logo-a.png(Follow on Twitter)!:http://www.twitter.com/rails_apps Follow on Twitter !http://railsapps.github.com/images/mailing-list-icon.jpg(Join the Mailing List)!:http://eepurl.com/dQx3o Join the Mailing List
+h2. !http://twitter-badges.s3.amazonaws.com/t_logo-a.png(Follow on Twitter)!:http://www.twitter.com/rails_apps Follow on Twitter
Follow the project on Twitter: "@rails_apps":http://twitter.com/rails_apps. Please tweet some praise if you like what you've found.
-<a href="http://eepurl.com/dQx3o">Join the email list</a> (low volume, announcements only) for project updates and my tips about Rails resources.
-
h2. !http://railsapps.github.com/images/rails-36x36.jpg(Tutorial)! Tutorial
-A complete walkthrough tutorial for Rails 3.1 is available on the GitHub wiki:
+A complete walkthrough tutorial is available on the GitHub wiki:
h4. "View the Tutorial":https://github.com/RailsApps/rails3-devise-rspec-cucumber/wiki/Tutorial
@@ -38,16 +36,10 @@ h2. Dependencies
Before generating your application, you will need:
-* The Ruby language (version 1.9.2)
-** @$ ruby -v@
-* Rails 3.1
-** @$ rails -v@
-* Rake 0.9.2
-** @$ rake --version@
-
-You must update the standard Ruby installation from Rake 0.8.7 to Rake 0.9.2 before using the application templates to generate a new Rails app.
+* The Ruby language (version 1.9.3)
+* Rails 3.2
-See "Installing Rails 3.1":http://railsapps.github.com/installing-rails-3-1.html and "Managing Rails Versions and Gems":http://railsapps.github.com/managing-rails-versions-gems.html for detailed instructions and advice.
+See "Installing Rails 3.2":http://railsapps.github.com/installing-rails.html for detailed instructions and advice.
h2. Getting the Application
@@ -67,18 +59,14 @@ You can use an application template to generate a new version of the example app
To build the "rails3-devise-rspec-cucumber" example application, run the command:
-@$ rails new myapp -m https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-devise-rspec-cucumber-template.rb -T@
+@rails new myapp -m https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-devise-rspec-cucumber-template.rb -T@
-Use the @-T@ flag to skip Test::Unit files. Add the @-J@ flag to skip Prototype files for Rails 3.0 (not needed for Rails 3.1).
-
-bq. You MUST be using Rails 3.0.4 or newer. Generating a Rails application from an “HTTPS” URL does not work in Rails 3.0.3 and earlier versions.
+Use the @-T@ flag to skip Test::Unit files.
This creates a new Rails app (with the name @myapp@) on your computer.
The application generator template will ask you for your preferences:
-* Would you like to use jQuery?
-* Would you like to use jQuery UI?
* Would you like to use Haml instead of ERB?
* Would you like to use RSpec instead of TestUnit?
* Would you like to use factory_girl for test fixtures with RSpec?
@@ -91,6 +79,12 @@ The application generator template will ask you for your preferences:
* Completely reset all CSS to eliminate styling?
* Would you like to set a robots.txt file to ban spiders?
* Would you like to use ‘rails-footnotes’ during development?
+* Which front-end framework would you like for HTML5 and CSS3?
+## None
+## Zurb Foundation
+## Twitter Bootstrap
+## Skeleton
+## Normalize CSS for consistent styling
h4. Use "Recipes" to Customize an Application Template
@@ -114,10 +108,6 @@ The application uses the following gems:
* "capybara":http://rubygems.org/gems/capybara
* "devise":http://rubygems.org/gems/devise
-See an example "Rails 3.1.3 Gemfile":http://railsapps.github.com/rails-3-1-3-example-gemfile.html.
-
-See "Managing Rails Versions and Gems":http://railsapps.github.com/managing-rails-versions-gems.html for advice and details.
-
h4. Install the Required Gems
Install the required gems on your computer:
@@ -219,6 +209,12 @@ h4. Issues
Please create a "GitHub issue":http://github.com/RailsApps/rails3-devise-rspec-cucumber/issues if you identify any problems or have suggestions for improvements.
+h4. Where to Get Help
+
+Your best source for help with problems is "Stack Overflow":http://stackoverflow.com/questions/tagged/ruby-on-rails-3. Your issue may have been encountered and addressed by others.
+
+You can also try "Rails Hotline":http://www.railshotline.com/, a free telephone hotline for Rails help staffed by volunteers.
+
h2. Contributing
If you make improvements to this application, please share with others.
@@ -1,9 +1,15 @@
-// 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
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
//= require jquery
//= require jquery_ujs
//= require_tree .
@@ -1,28 +0,0 @@
-/*
- * 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 .
-*/
-header nav ul {
- list-style: none;
- margin: 0 0 2em;
- padding: 0;
-}
-header nav ul li {
- display: inline;
-}
-#flash_notice, #flash_alert {
- padding: 5px 8px;
- margin: 10px 0;
-}
-#flash_notice {
- background-color: #CFC;
- border: solid 1px #6C6;
-}
-#flash_alert {
- background-color: #FCC;
- border: solid 1px #C66;
-}
-
@@ -0,0 +1,35 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * 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 .
+*/
+
+header nav ul {
+ list-style: none;
+ margin: 0 0 2em;
+ padding: 0;
+}
+header nav ul li {
+ display: inline;
+}
+#flash_notice, #flash_alert {
+ padding: 5px 8px;
+ margin: 10px 0;
+}
+#flash_notice {
+ background-color: #CFC;
+ border: solid 1px #6C6;
+}
+#flash_alert {
+ background-color: #FCC;
+ border: solid 1px #C66;
+}
+
@@ -5,5 +5,4 @@ def show
@user = User.find(params[:id])
end
-
end
@@ -9,4 +9,4 @@
<div><%= f.submit "Resend confirmation instructions" %></div>
<% end %>
-<%= render :partial => "devise/shared/links" %>
+<%= render "links" %>
@@ -1,5 +1,5 @@
<p>Welcome <%= @resource.email %>!</p>
-<p>You can confirm your account through the link below:</p>
+<p>You can confirm your account email through the link below:</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
@@ -13,4 +13,4 @@
<div><%= f.submit "Change my password" %></div>
<% end %>
-<%= render :partial => "devise/shared/links" %>
+<%= render "links" %>
@@ -9,4 +9,4 @@
<div><%= f.submit "Send me reset password instructions" %></div>
<% end %>
-<%= render :partial => "devise/shared/links" %>
+<%= render "links" %>
@@ -17,4 +17,4 @@
<div><%= f.submit "Sign up" %></div>
<% end %>
-<%= render :partial => "devise/shared/links" %>
+<%= render "links" %>
@@ -14,4 +14,4 @@
<div><%= f.submit "Sign in" %></div>
<% end %>
-<%= render :partial => "devise/shared/links" %>
+<%= render "links" %>
@@ -9,4 +9,4 @@
<div><%= f.submit "Resend unlock instructions" %></div>
<% end %>
-<%= render :partial => "devise/shared/links" %>
+<%= render "links" %>
@@ -7,7 +7,7 @@
<title>Myapp</title>
<meta name="description" content="">
<meta name="author" content="">
- <%= stylesheet_link_tag "application" %>
+ <%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
@@ -20,7 +20,7 @@
</ul>
</nav>
<%- flash.each do |name, msg| -%>
- <%= content_tag :div, msg, :id => "flash_\#{name}" if msg.is_a?(String) %>
+ <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
<%- end -%>
</header>
<div id="main" role="main">
View
@@ -22,7 +22,7 @@ class Application < Rails::Application
config.generators do |g|
g.view_specs false
g.helper_specs false
- g.test_framework :rspec
+
end
# Settings in config/environments/* take precedence over those specified here.
@@ -31,6 +31,8 @@ class Application < Rails::Application
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
+ config.autoload_paths += %W(#{config.root}/lib)
+
# 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.
@@ -53,6 +55,17 @@ class Application < Rails::Application
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password, :password_confirmation]
+ # Use SQL instead of Active Record's schema dumper when creating the 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
+
+ # Enforce whitelist mode for mass assignment.
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
+ # parameters by using an attr_accessible or attr_protected declaration.
+ # config.active_record.whitelist_attributes = true
+
# Enable the asset pipeline
config.assets.enabled = true
@@ -2,7 +2,7 @@
# 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
+ # 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
@@ -28,6 +28,13 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
+
+ # 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
+
# Do not compress assets
config.assets.compress = false
@@ -33,8 +33,11 @@
# See everything in the log (default is :info)
# config.log_level = :debug
+ # Prepend all log lines with the following tags
+ # config.log_tags = [ :subdomain, :uuid ]
+
# Use a different logger for distributed setups
- # config.logger = SyslogLogger.new
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production
# config.cache_store = :mem_cache_store
@@ -2,9 +2,9 @@
# 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
+ # 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!
+ # 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
@@ -29,10 +29,8 @@
# 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
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
Oops, something went wrong.

0 comments on commit 52fb0f6

Please sign in to comment.