Added the possibility of specifying fixtures in multiple calls #816 [kim@tinker.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@915 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 78a732bf
*SVN* *SVN*
* Added the possibility of specifying fixtures in multiple calls #816 [kim@tinker.com]
* Added Base.exists?(id) that'll return true if an object of the class with the given id exists #854 [stian@grytoyr.net] * Added Base.exists?(id) that'll return true if an object of the class with the given id exists #854 [stian@grytoyr.net]
* Added optionally allow for nil or empty strings with validates_numericality_of #801 [Sebastian Kanthak] * Added optionally allow for nil or empty strings with validates_numericality_of #801 [Sebastian Kanthak]
......
...@@ -367,7 +367,7 @@ class TestCase #:nodoc: ...@@ -367,7 +367,7 @@ class TestCase #:nodoc:
self.use_instantiated_fixtures = true self.use_instantiated_fixtures = true
def self.fixtures(*table_names) def self.fixtures(*table_names)
self.fixture_table_names = table_names.flatten self.fixture_table_names |= table_names.flatten
require_fixture_classes require_fixture_classes
end end
......
...@@ -136,3 +136,23 @@ def test_destroy_just_kidding ...@@ -136,3 +136,23 @@ def test_destroy_just_kidding
assert_not_nil @first assert_not_nil @first
end end
end end
class MultipleFixturesTest < Test::Unit::TestCase
fixtures :topics
fixtures :developers, :accounts
def test_fixture_table_names
assert_equal([:topics, :developers, :accounts], fixture_table_names)
end
end
class OverlappingFixturesTest < Test::Unit::TestCase
fixtures :topics, :developers
fixtures :developers, :accounts
def test_fixture_table_names
assert_equal([:topics, :developers, :accounts], fixture_table_names)
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册