1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #26466 from y-yagi/remove_duplicated_fixture_set_names

remove duplicated fixture set names
This commit is contained in:
Arthur Nogueira Neves 2016-09-13 13:21:28 -04:00 committed by GitHub
commit c49751be1f
3 changed files with 5 additions and 3 deletions

View file

@ -902,7 +902,7 @@ module ActiveRecord
def fixtures(*fixture_set_names)
if fixture_set_names.first == :all
fixture_set_names = Dir["#{fixture_path}/{**,*}/*.{yml}"]
fixture_set_names = Dir["#{fixture_path}/{**,*}/*.{yml}"].uniq
fixture_set_names.map! { |f| f[(fixture_path.to_s.size + 1)..-5] }
else
fixture_set_names = fixture_set_names.flatten.map(&:to_s)

View file

@ -728,7 +728,7 @@ class LoadAllFixturesTest < ActiveRecord::TestCase
self.class.fixtures :all
if File.symlink? FIXTURES_ROOT + "/all/admin"
assert_equal %w(admin/accounts admin/users developers people tasks), fixture_table_names.sort
assert_equal %w(admin/accounts admin/users developers namespaced/accounts people tasks), fixture_table_names.sort
end
ensure
ActiveRecord::FixtureSet.reset_cache
@ -741,7 +741,7 @@ class LoadAllFixturesWithPathnameTest < ActiveRecord::TestCase
self.class.fixtures :all
if File.symlink? FIXTURES_ROOT + "/all/admin"
assert_equal %w(admin/accounts admin/users developers people tasks), fixture_table_names.sort
assert_equal %w(admin/accounts admin/users developers namespaced/accounts people tasks), fixture_table_names.sort
end
ensure
ActiveRecord::FixtureSet.reset_cache

View file

@ -0,0 +1,2 @@
signals37:
name: 37signals