提交 e9b02ae2 编写于 作者: J José Valim

Add test for belongs_to? and group initializers.

上级 6795a9b3
......@@ -61,7 +61,7 @@ class Parent
class Instance
include Rails::Initializable
initializer :one do
initializer :one, :group => :assets do
$arr << 1
end
......@@ -69,7 +69,7 @@ class Instance
$arr << 2
end
initializer :three do
initializer :three, :group => :all do
$arr << 3
end
......@@ -211,6 +211,13 @@ class InstanceTest < ActiveSupport::TestCase
instance.run_initializers
assert_equal [1, 2, 3, 4], $arr
end
test "running locals with groups" do
$arr = []
instance = Instance.new
instance.run_initializers(:assets)
assert_equal [1, 3], $arr
end
end
class WithArgsTest < ActiveSupport::TestCase
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册