aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/test/generators/model_generator_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb
index 9dd61e9c15..01ab77ee20 100644
--- a/railties/test/generators/model_generator_test.rb
+++ b/railties/test/generators/model_generator_test.rb
@@ -264,39 +264,39 @@ class ModelGeneratorTest < Rails::Generators::TestCase
error = capture(:stderr) { run_generator ["Account", "--force"] }
assert_no_match(/Another migration is already named create_accounts/, error)
assert_no_file old_migration
- assert_migration 'db/migrate/create_accounts.rb'
+ assert_migration "db/migrate/create_accounts.rb"
end
def test_invokes_default_test_framework
run_generator
assert_file "test/models/account_test.rb", /class AccountTest < ActiveSupport::TestCase/
- assert_file 'test/fixtures/accounts.yml', /name: MyString/, /age: 1/
- assert_generated_fixture('test/fixtures/accounts.yml',
- {'one'=>{'name'=>'MyString', 'age'=>1}, 'two'=>{'name'=>'MyString', 'age'=>1}})
+ assert_file "test/fixtures/accounts.yml", /name: MyString/, /age: 1/
+ assert_generated_fixture("test/fixtures/accounts.yml",
+ {"one"=>{"name"=>"MyString", "age"=>1}, "two"=>{"name"=>"MyString", "age"=>1}})
end
def test_fixtures_use_the_references_ids
run_generator ["LineItem", "product:references", "cart:belongs_to"]
- assert_file 'test/fixtures/line_items.yml', /product_id: \n cart_id: /
- assert_generated_fixture('test/fixtures/line_items.yml',
+ assert_file "test/fixtures/line_items.yml", /product_id: \n cart_id: /
+ assert_generated_fixture("test/fixtures/line_items.yml",
{"one"=>{"product_id"=>nil, "cart_id"=>nil}, "two"=>{"product_id"=>nil, "cart_id"=>nil}})
end
def test_fixtures_use_the_references_ids_and_type
run_generator ["LineItem", "product:references{polymorphic}", "cart:belongs_to"]
- assert_file 'test/fixtures/line_items.yml', /product_id: \n product_type: Product\n cart_id: /
- assert_generated_fixture('test/fixtures/line_items.yml',
+ assert_file "test/fixtures/line_items.yml", /product_id: \n product_type: Product\n cart_id: /
+ assert_generated_fixture("test/fixtures/line_items.yml",
{"one"=>{"product_id"=>nil, "product_type"=>"Product", "cart_id"=>nil},
"two"=>{"product_id"=>nil, "product_type"=>"Product", "cart_id"=>nil}})
end
def test_fixtures_respect_reserved_yml_keywords
- run_generator ["LineItem", "no:integer", "Off:boolean", 'ON:boolean']
+ run_generator ["LineItem", "no:integer", "Off:boolean", "ON:boolean"]
- assert_generated_fixture('test/fixtures/line_items.yml',
+ assert_generated_fixture("test/fixtures/line_items.yml",
{"one"=>{"no"=>1, "Off"=>false, "ON"=>false}, "two"=>{"no"=>1, "Off"=>false, "ON"=>false}})
end