From 4e23e6596418a830d56c3750341e3eebcac7c9ef Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 10 Jun 2007 23:06:47 +0000 Subject: Get picky about weird Ruby style. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6991 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../generators/rails_scaffold_generator_test.rb | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'railties/test') diff --git a/railties/test/generators/rails_scaffold_generator_test.rb b/railties/test/generators/rails_scaffold_generator_test.rb index f129efbd81..419ff2b6ff 100644 --- a/railties/test/generators/rails_scaffold_generator_test.rb +++ b/railties/test/generators/rails_scaffold_generator_test.rb @@ -68,7 +68,7 @@ class RailsScaffoldGeneratorTest < Test::Unit::TestCase Dir.mkdir("#{RAILS_ROOT}/test/fixtures") unless File.exists?("#{RAILS_ROOT}/test/fixtures") Dir.mkdir("#{RAILS_ROOT}/public") unless File.exists?("#{RAILS_ROOT}/public") Dir.mkdir("#{RAILS_ROOT}/public/stylesheets") unless File.exists?("#{RAILS_ROOT}/public/stylesheets") - File.open("#{RAILS_ROOT}/config/routes.rb",'w') do |f| + File.open("#{RAILS_ROOT}/config/routes.rb", 'w') do |f| f<<"ActionController::Routing::Routes.draw do |map|\n\nend\n" end end @@ -97,19 +97,19 @@ class RailsScaffoldGeneratorTest < Test::Unit::TestCase assert_generated_controller_for :products do |f| - assert_has_method f,:index do |name,m| + assert_has_method f, :index do |name, m| assert_match /@products = Product\.find\(:all\)/, m, "#{name} should query products table" end - assert_has_method f,:show,:edit,:update,:destroy do |name,m| + assert_has_method f, :show, :edit, :update, :destroy do |name, m| assert_match /@product = Product\.find\(params\[:id\]\)/, m, "#{name.to_s} should query products table" end - assert_has_method f,:new do |name,m| + assert_has_method f, :new do |name, m| assert_match /@product = Product\.new/, m, "#{name.to_s} should instantiate a product" end - assert_has_method f,:create do |name,m| + assert_has_method f, :create do |name, m| assert_match /@product = Product\.new\(params\[:product\]\)/, m, "#{name.to_s} should instantiate a product" assert_match /format.xml \{ render :xml => @product.errors, :status => :unprocessable_entity \}/, m, "#{name.to_s} should set status to :unprocessable_entity code for xml" end @@ -122,7 +122,7 @@ class RailsScaffoldGeneratorTest < Test::Unit::TestCase assert_generated_fixtures_for :products assert_generated_helper_for :products assert_generated_stylesheet :scaffold - assert_generated_views_for :products, "index.html.erb","new.html.erb","edit.html.erb","show.html.erb" + assert_generated_views_for :products, "index.html.erb", "new.html.erb", "edit.html.erb", "show.html.erb" assert_generated_migration :create_products assert_added_route_for :products end @@ -132,19 +132,19 @@ class RailsScaffoldGeneratorTest < Test::Unit::TestCase assert_generated_controller_for :products do |f| - assert_has_method f,:index do |name,m| + assert_has_method f, :index do |name, m| assert_match /@products = Product\.find\(:all\)/, m, "#{name} should query products table" end - assert_has_method f,:show,:edit,:update,:destroy do |name,m| + assert_has_method f, :show, :edit, :update, :destroy do |name, m| assert_match /@product = Product\.find\(params\[:id\]\)/, m, "#{name.to_s} should query products table" end - assert_has_method f,:new do |name,m| + assert_has_method f, :new do |name, m| assert_match /@product = Product\.new/, m, "#{name.to_s} should instantiate a product" end - assert_has_method f,:create do |name,m| + assert_has_method f, :create do |name, m| assert_match /@product = Product\.new\(params\[:product\]\)/, m, "#{name.to_s} should instantiate a product" assert_match /format.xml \{ render :xml => @product.errors, :status => :unprocessable_entity \}/, m, "#{name.to_s} should set status to :unprocessable_entity code for xml" end @@ -157,11 +157,11 @@ class RailsScaffoldGeneratorTest < Test::Unit::TestCase assert_generated_fixtures_for :products assert_generated_helper_for :products assert_generated_stylesheet :scaffold - assert_generated_views_for :products, "index.html.erb","new.html.erb","edit.html.erb","show.html.erb" + assert_generated_views_for :products, "index.html.erb", "new.html.erb", "edit.html.erb", "show.html.erb" assert_generated_migration :create_products do |t| assert_generated_column t, :name, :string assert_generated_column t, :supplier_id, :integer - assert_generated_column t, :created_at,:timestamp + assert_generated_column t, :created_at, :timestamp end assert_added_route_for :products -- cgit v1.2.3