diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-22 15:45:18 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-22 15:58:58 +0100 |
commit | ede01ce8b27c752de66dcb96aa9b8d3a29e61111 (patch) | |
tree | 91e63a62f8e202a4b71a8ad68f3364aabff9dd9a /railties/test/generators/migration_generator_test.rb | |
parent | 334e5cab2a999ef246ae0c31d0b939ef185cfe63 (diff) | |
download | rails-ede01ce8b27c752de66dcb96aa9b8d3a29e61111.tar.gz rails-ede01ce8b27c752de66dcb96aa9b8d3a29e61111.tar.bz2 rails-ede01ce8b27c752de66dcb96aa9b8d3a29e61111.zip |
Support decimal{1,2} and decimal{1-2} and decimal{1.2} so it works fine with bash, zsh, etc, closes #4602
Diffstat (limited to 'railties/test/generators/migration_generator_test.rb')
-rw-r--r-- | railties/test/generators/migration_generator_test.rb | 6 |
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 cdac014965..3f4e160988 100644 --- a/railties/test/generators/migration_generator_test.rb +++ b/railties/test/generators/migration_generator_test.rb @@ -105,18 +105,18 @@ 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,/, up) - assert_match(/, :precision => 5/, up) + assert_match(/, :precision => 1/, up) assert_match(/, :scale => 2/, up) assert_match(/add_column :books, :discount, :decimal,/, up) assert_match(/, :precision => 3/, up) - assert_match(/, :scale => 2/, up) + assert_match(/, :scale => 4/, up) end assert_match(/add_index :books, :title/, content) assert_match(/add_index :books, :price/, content) |