跳至内容 跳至搜索
命名空间
方法
F

类公共方法

fixture_paths

返回 ActiveRecord::FixtureSet 集合

# File activerecord/lib/active_record/test_fixtures.rb, line 22
      

fixture_paths=(fixture_paths)

# File activerecord/lib/active_record/test_fixtures.rb, line 31
class_attribute :fixture_paths, instance_writer: false, default: []

实例公共方法

fixture(fixture_set_name, *fixture_names)

用于可能与其他方法冲突的 fixture 标识符的通用 fixture 访问器。

assert_equal "Ruby on Rails", web_sites(:rubyonrails).name
assert_equal "Ruby on Rails", fixture(:web_sites, :rubyonrails).name
# File activerecord/lib/active_record/test_fixtures.rb, line 103
def fixture(fixture_set_name, *fixture_names)
  active_record_fixture(fixture_set_name, *fixture_names)
end