提交 899cae25 编写于 作者: R Rafael Mendonça França

Consistent use of single and double quotes

上级 d7927372
......@@ -264,39 +264,39 @@ def test_existing_migration_is_removed_on_force
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册