Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test for belongs_to? and group initializers.

  • Loading branch information...
commit e9b02ae27a837d7ba02681e225590f55ce02af8c 1 parent 6795a9b
@josevalim josevalim authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 railties/test/initializable_test.rb
View
11 railties/test/initializable_test.rb
@@ -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

0 comments on commit e9b02ae

Please sign in to comment.
Something went wrong with that request. Please try again.