aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-01-22 15:45:18 +0100
committerJosé Valim <jose.valim@gmail.com>2012-01-22 15:59:31 +0100
commit1f9d6a0bf1307eb45d676b88dcdde87355b5b90d (patch)
tree16b4f76f3b31a6ba5001b65e6aa2d2fa1a1d8210 /railties/test/generators
parentc3aaacafaa0576d3464b568e8fa693e72699c66d (diff)
downloadrails-1f9d6a0bf1307eb45d676b88dcdde87355b5b90d.tar.gz
rails-1f9d6a0bf1307eb45d676b88dcdde87355b5b90d.tar.bz2
rails-1f9d6a0bf1307eb45d676b88dcdde87355b5b90d.zip
Support decimal{1,2} and decimal{1-2} and decimal{1.2} so it works fine with bash, zsh, etc, closes #4602
Conflicts: railties/test/generators/migration_generator_test.rb
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/migration_generator_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/test/generators/migration_generator_test.rb b/railties/test/generators/migration_generator_test.rb
index 68fbd58061..4e08e5dae1 100644
--- a/railties/test/generators/migration_generator_test.rb
+++ b/railties/test/generators/migration_generator_test.rb
@@ -105,14 +105,14 @@ class MigrationGeneratorTest < Rails::Generators::TestCase
def test_add_migration_with_attributes_index_declaration_and_attribute_options
migration = "add_title_and_content_to_books"
- run_generator [migration, "title:string{40}:index", "content:string{255}", "price:decimal{5,2}:index", "discount:decimal{3,2}:uniq"]
+ run_generator [migration, "title:string{40}:index", "content:string{255}", "price:decimal{1,2}:index", "discount:decimal{3.4}:uniq"]
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, :price, :decimal, precision: 1, scale: 2/, up)
+ assert_match(/add_column :books, :discount, :decimal, precision: 3, scale: 4/, up)
end
assert_match(/add_index :books, :title/, content)
assert_match(/add_index :books, :price/, content)