diff options
author | José Valim <jose.valim@gmail.com> | 2011-09-24 02:40:02 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-09-24 03:17:43 +0200 |
commit | e9b02ae27a837d7ba02681e225590f55ce02af8c (patch) | |
tree | 40aeff80d73569cd76bafb409ccc520926ef1239 /railties/test | |
parent | 6795a9b30905a6e0b28a8d5458b452cb385d21b2 (diff) | |
download | rails-e9b02ae27a837d7ba02681e225590f55ce02af8c.tar.gz rails-e9b02ae27a837d7ba02681e225590f55ce02af8c.tar.bz2 rails-e9b02ae27a837d7ba02681e225590f55ce02af8c.zip |
Add test for belongs_to? and group initializers.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/initializable_test.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/railties/test/initializable_test.rb b/railties/test/initializable_test.rb index 293e73519d..1dbcc249ab 100644 --- a/railties/test/initializable_test.rb +++ b/railties/test/initializable_test.rb @@ -61,7 +61,7 @@ module InitializableTests class Instance include Rails::Initializable - initializer :one do + initializer :one, :group => :assets do $arr << 1 end @@ -69,7 +69,7 @@ module InitializableTests $arr << 2 end - initializer :three do + initializer :three, :group => :all do $arr << 3 end @@ -211,6 +211,13 @@ module InitializableTests 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 |