Permalink
Browse files

Add test for belongs_to? and group initializers.

  • Loading branch information...
1 parent 2a68867 commit 0a4b8fb7f47047f97461fceef7ac9caf03cfafa1 @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 0a4b8fb

Please sign in to comment.