Valid Authenticity Token

Start with a new project

ruby -rubygems /home/rubys/git/rails/railties/bin/rails testapp
      create  
      create  README
      create  .gitignore
      create  Rakefile
      create  config.ru
      create  Gemfile
      create  app
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/models
      create  app/views/layouts
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/test.rb
      create  config/environments/production.rb
      create  config/environments/development.rb
      create  config/initializers
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/cookie_verification_secret.rb
      create  config/initializers/inflections.rb
      create  config/initializers/session_store.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  doc
      create  doc/README_FOR_APP
      create  lib
      create  lib/tasks
      create  lib/tasks/.gitkeep
      create  log
      create  log/server.log
      create  log/production.log
      create  log/development.log
      create  log/test.log
      create  public
      create  public/422.html
      create  public/404.html
      create  public/robots.txt
      create  public/500.html
      create  public/index.html
      create  public/favicon.ico
      create  public/images
      create  public/images/rails.png
      create  public/stylesheets
      create  public/stylesheets/.gitkeep
      create  public/javascripts
      create  public/javascripts/controls.js
      create  public/javascripts/rails.js
      create  public/javascripts/application.js
      create  public/javascripts/prototype.js
      create  public/javascripts/effects.js
      create  public/javascripts/dragdrop.js
      create  script
      create  script/rails
      create  test
      create  test/performance/browsing_test.rb
      create  test/test_helper.rb
      create  test/unit
      create  test/fixtures
      create  test/functional
      create  test/integration
      create  tmp
      create  tmp/sessions
      create  tmp/sockets
      create  tmp/cache
      create  tmp/pids
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
bundle install
Resolving dependencies
Installing abstract (1.0.0) from system gems 
Installing actionmailer (3.0.0.beta1) from source code at /home/rubys/git/rails 
Installing actionpack (3.0.0.beta1) from source code at /home/rubys/git/rails 
Installing activemodel (3.0.0.beta1) from source code at /home/rubys/git/rails 
Installing activerecord (3.0.0.beta1) from source code at /home/rubys/git/rails 
Installing activeresource (3.0.0.beta1) from source code at /home/rubys/git/rails 
Installing activesupport (3.0.0.beta1) from source code at /home/rubys/git/rails 
Installing arel (0.2.1) from system gems 
Installing builder (2.1.2) from system gems 
Installing bundler (0.9.10) from system gems 
Installing erubis (2.6.5) from system gems 
Installing i18n (0.3.5) from system gems 
Installing mail (2.1.3) from system gems 
Installing memcache-client (1.7.8) from system gems 
Installing mime-types (1.16) from system gems 
Installing rack (1.1.0) from system gems 
Installing rack-mount (0.5.2) from system gems 
Installing rack-test (0.5.3) from system gems 
Installing rails (3.0.0.beta1) from source code at /home/rubys/git/rails 
Installing railties (3.0.0.beta1) from source code at /home/rubys/git/rails 
Installing rake (0.8.7) from system gems 
Installing sqlite3-ruby (1.2.5) from system gems 
Installing text-format (1.0.0) from system gems 
Installing text-hyphen (1.0.0) from system gems 
Installing thor (0.13.4) from system gems 
Installing tzinfo (0.3.16) from system gems 
Your bundle is complete!

About as simple of a scaffold as you can get

rails generate scaffold product title:string
      invoke  active_record
      create    db/migrate/20100306014055_create_products.rb
      create    app/models/product.rb
      invoke    test_unit
      create      test/unit/product_test.rb
      create      test/fixtures/products.yml
       route  resources :products
      invoke  scaffold_controller
      create    app/controllers/products_controller.rb
      invoke    erb
      create      app/views/products
      create      app/views/products/index.html.erb
      create      app/views/products/edit.html.erb
      create      app/views/products/show.html.erb
      create      app/views/products/new.html.erb
      create      app/views/products/_form.html.erb
      create      app/views/layouts/products.html.erb
      invoke    test_unit
      create      test/functional/products_controller_test.rb
      invoke    helper
      create      app/helpers/products_helper.rb
      invoke      test_unit
      create        test/unit/helpers/products_helper_test.rb
      invoke  stylesheets
      create    public/stylesheets/scaffold.css
rake db:migrate
mv 20100306014055_create_products.rb 20100301000001_create_products.rb
(in /home/rubys/tmp/work/testapp)
==  CreateProducts: migrating =================================================
-- create_table(:products)
   -> 0.0027s
==  CreateProducts: migrated (0.0029s) ========================================
 
rake db:test:prepare
(in /home/rubys/tmp/work/testapp)

A very simple integration test

edit test/integration/product_integration_test.rb
require 'test_helper'
 
class ProductIntegrationTest < ActionController::IntegrationTest
  test 'creating a product' do
    post_via_redirect '/products', :product => {:title => 'Widget'}
    assert_response :success
  end
end

run it

rake test:integration
(in /home/rubys/tmp/work/testapp)
Loaded suite /home/rubys/.rvm/gems/ruby-1.8.7-p249%global/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
E
Finished in 0.144512 seconds.
 
  1) Error:
test_creating_a_product(ProductIntegrationTest):
ActionController::InvalidAuthenticityToken: ActionController::InvalidAuthenticityToken
 
 
1 tests, 0 assertions, 0 failures, 1 errors
rake aborted!
Command failed with status (1): [/home/rubys/.rvm/rubies/ruby-1.8.7-p249/bi...]

(See full trace by running task with --trace)
</1 tests, 1 assertions, 0 failures, 0 errors/> expected but was
<"(in /home/rubys/tmp/work/testapp)">.

Traceback:
  /home/rubys/tmp/integration.rb:30
  /home/rubys/git/gorp/lib/gorp/test.rb:156:in `call'
  /home/rubys/git/gorp/lib/gorp/test.rb:156:in `rake'
  /home/rubys/tmp/integration.rb:29

Environment

Sat, 06 Mar 2010 01:41:06 GMT
/home/rubys/.rvm/rubies/ruby-1.8.7-p249/bin/ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
gem -v
1.3.6
bundle show
Gems included by the bundle:
  * abstract (1.0.0)
  * actionmailer (3.0.0.beta1)
  * actionpack (3.0.0.beta1)
  * activemodel (3.0.0.beta1)
  * activerecord (3.0.0.beta1)
  * activeresource (3.0.0.beta1)
  * activesupport (3.0.0.beta1)
  * arel (0.2.1)
  * builder (2.1.2)
  * bundler (0.9.10)
  * erubis (2.6.5)
  * i18n (0.3.5)
  * mail (2.1.3)
  * memcache-client (1.7.8)
  * mime-types (1.16)
  * rack (1.1.0)
  * rack-mount (0.5.2)
  * rack-test (0.5.3)
  * rails (3.0.0.beta1)
  * railties (3.0.0.beta1)
  * rake (0.8.7)
  * sqlite3-ruby (1.2.5)
  * text-format (1.0.0)
  * text-hyphen (1.0.0)
  * thor (0.13.4)
  * tzinfo (0.3.16)
rake about
(in /home/rubys/tmp/work/testapp)
About your application's environment
Ruby version              1.8.7 (x86_64-linux)
RubyGems version          1.3.6
Rack version              1.1
Rails version             3.0.0.beta1
Active Record version     3.0.0.beta1
Action Pack version       3.0.0.beta1
Active Resource version   3.0.0.beta1
Action Mailer version     3.0.0.beta1
Active Support version    3.0.0.beta1
Middleware                ActionDispatch::Static, Rack::Lock, Rack::Runtime, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::RemoteIp, Rack::Sendfile, ActionDispatch::Callbacks, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, Rack::MethodOverride, ActionDispatch::Head
Application root          /home/rubys/tmp/work/testapp
Environment               development
git log -1
commit 67512b9489593ddcd1c0c87ba0052380355b5400
Author: Stijn Mathysen <stijn@skylight.be>
Date:   Fri Mar 5 08:04:25 2010 +0100

    Removed the + sign as an accepted character from the parameterize method, as a + sign is interpreted by the browser as a space, possibly resulting in a "ArgumentError: illegal character in key"
    
    [#4080 state:committed]
    
    Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>