From 7c9bcbb5e486a5d5e35d38c5fbcbea6af88fc23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@gmail.com> Date: Sat, 24 Dec 2011 22:06:25 +0100 Subject: Use 1.9 hash syntax instead. --- railties/test/generators/migration_generator_test.rb | 14 +++++++------- railties/test/generators/model_generator_test.rb | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'railties/test') diff --git a/railties/test/generators/migration_generator_test.rb b/railties/test/generators/migration_generator_test.rb index d81fc59fbf..68fbd58061 100644 --- a/railties/test/generators/migration_generator_test.rb +++ b/railties/test/generators/migration_generator_test.rb @@ -69,7 +69,7 @@ class MigrationGeneratorTest < Rails::Generators::TestCase assert_match(/add_column :posts, :user_id, :integer/, up) end assert_match(/add_index :posts, :title/, content) - assert_match(/add_index :posts, :user_id, :unique => true/, content) + assert_match(/add_index :posts, :user_id, unique: true/, content) end end @@ -99,7 +99,7 @@ class MigrationGeneratorTest < Rails::Generators::TestCase assert_match(/add_column :posts, :user_uuid, :string/, up) end assert_match(/add_index :posts, :title/, content) - assert_match(/add_index :posts, :user_uuid, :unique => true/, content) + assert_match(/add_index :posts, :user_uuid, unique: true/, content) end end @@ -109,14 +109,14 @@ class MigrationGeneratorTest < Rails::Generators::TestCase assert_migration "db/migrate/#{migration}.rb" do |content| assert_method :change, content do |up| - assert_match(/add_column :books, :title, :string, :limit=>40/, up) - assert_match(/add_column :books, :content, :string, :limit=>255/, up) - assert_match(/add_column :books, :price, :decimal, :precision=>5, :scale=>2/, up) - assert_match(/add_column :books, :discount, :decimal, :precision=>3, :scale=>2/, up) + assert_match(/add_column :books, :title, :string, limit: 40/, up) + assert_match(/add_column :books, :content, :string, limit: 255/, up) + assert_match(/add_column :books, :price, :decimal, precision: 5, scale: 2/, up) + assert_match(/add_column :books, :discount, :decimal, precision: 3, scale: 2/, up) end assert_match(/add_index :books, :title/, content) assert_match(/add_index :books, :price/, content) - assert_match(/add_index :books, :discount, :unique => true/, content) + assert_match(/add_index :books, :discount, unique: true/, content) end end diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb index ffb3d2ceba..156fa86eee 100644 --- a/railties/test/generators/model_generator_test.rb +++ b/railties/test/generators/model_generator_test.rb @@ -126,8 +126,8 @@ class ModelGeneratorTest < Rails::Generators::TestCase assert_match(/add_index :products, :name/, up) assert_match(/add_index :products, :supplier_id/, up) - assert_match(/add_index :products, :user_id, :unique => true/, up) - assert_match(/add_index :products, :order_id, :unique => true/, up) + assert_match(/add_index :products, :user_id, unique: true/, up) + assert_match(/add_index :products, :order_id, unique: true/, up) end end end @@ -171,13 +171,13 @@ class ModelGeneratorTest < Rails::Generators::TestCase assert_migration "db/migrate/create_products.rb" do |content| assert_method :change, content do |up| assert_match(/create_table :products/, up) - assert_match(/t.string :title, :limit=>40/, up) - assert_match(/t.string :content, :limit=>255/, up) - assert_match(/t.decimal :price, :precision=>5, :scale=>2/, up) + assert_match(/t.string :title, limit: 40/, up) + assert_match(/t.string :content, limit: 255/, up) + assert_match(/t.decimal :price, precision: 5, scale: 2/, up) end assert_match(/add_index :products, :title/, content) assert_match(/add_index :products, :price/, content) - assert_match(/add_index :products, :discount, :unique => true/, content) + assert_match(/add_index :products, :discount, unique: true/, content) end end -- cgit v1.2.3