Permalink
Browse files

Add test for belongs_to? and group initializers.

  • Loading branch information...
1 parent 6795a9b commit e9b02ae27a837d7ba02681e225590f55ce02af8c @josevalim josevalim committed Sep 24, 2011
Showing with 9 additions and 2 deletions.
  1. +9 −2 railties/test/initializable_test.rb
@@ -61,15 +61,15 @@ class Parent
class Instance
include Rails::Initializable
- initializer :one do
+ initializer :one, :group => :assets do
$arr << 1
end
initializer :two do
$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

0 comments on commit e9b02ae

Please sign in to comment.