mirror of
https://github.com/github/rails.git
synced 2026-02-08 05:05:04 -05:00
Fix column type detection while loading fixtures. Closes #7987 [roderickvd]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6798 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -12,13 +12,15 @@ class FixturesTest < Test::Unit::TestCase
|
||||
self.use_instantiated_fixtures = true
|
||||
self.use_transactional_fixtures = false
|
||||
|
||||
fixtures :topics, :developers, :accounts, :tasks, :categories, :funny_jokes
|
||||
fixtures :topics, :developers, :accounts, :tasks, :categories, :funny_jokes, :binaries
|
||||
|
||||
FIXTURES = %w( accounts companies customers
|
||||
FIXTURES = %w( accounts binaries companies customers
|
||||
developers developers_projects entrants
|
||||
movies projects subscribers topics tasks )
|
||||
MATCH_ATTRIBUTE_NAME = /[a-zA-Z][-_\w]*/
|
||||
|
||||
BINARY_FIXTURE_PATH = File.dirname(__FILE__) + '/fixtures/flowers.jpg'
|
||||
|
||||
def test_clean_fixtures
|
||||
FIXTURES.each do |name|
|
||||
fixtures = nil
|
||||
@@ -100,7 +102,6 @@ class FixturesTest < Test::Unit::TestCase
|
||||
assert first
|
||||
end
|
||||
|
||||
|
||||
def test_bad_format
|
||||
path = File.join(File.dirname(__FILE__), 'fixtures', 'bad_fixtures')
|
||||
Dir.entries(path).each do |file|
|
||||
@@ -174,7 +175,6 @@ class FixturesTest < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def test_yml_file_in_subdirectory
|
||||
assert_equal(categories(:sub_special_1).name, "A special category in a subdir file")
|
||||
assert_equal(categories(:sub_special_1).class, SpecialCategory)
|
||||
@@ -185,7 +185,11 @@ class FixturesTest < Test::Unit::TestCase
|
||||
assert_equal(categories(:sub_special_3).class, SpecialCategory)
|
||||
end
|
||||
|
||||
|
||||
def test_binary_in_fixtures
|
||||
assert_equal 1, @binaries.size
|
||||
data = File.read(BINARY_FIXTURE_PATH).freeze
|
||||
assert_equal data, @flowers.data
|
||||
end
|
||||
end
|
||||
|
||||
if Account.connection.respond_to?(:reset_pk_sequence!)
|
||||
|
||||
Reference in New Issue
Block a user