Skip to content
This repository
Browse code

Add test for belongs_to? and group initializers.

  • Loading branch information...
commit e9b02ae27a837d7ba02681e225590f55ce02af8c 1 parent 6795a9b
José Valim josevalim authored

Showing 1 changed file with 9 additions and 2 deletions. Show diff stats Hide diff stats

  1. +9 2 railties/test/initializable_test.rb
11 railties/test/initializable_test.rb
@@ -61,7 +61,7 @@ class Parent
61 61 class Instance
62 62 include Rails::Initializable
63 63
64   - initializer :one do
  64 + initializer :one, :group => :assets do
65 65 $arr << 1
66 66 end
67 67
@@ -69,7 +69,7 @@ class Instance
69 69 $arr << 2
70 70 end
71 71
72   - initializer :three do
  72 + initializer :three, :group => :all do
73 73 $arr << 3
74 74 end
75 75
@@ -211,6 +211,13 @@ class InstanceTest < ActiveSupport::TestCase
211 211 instance.run_initializers
212 212 assert_equal [1, 2, 3, 4], $arr
213 213 end
  214 +
  215 + test "running locals with groups" do
  216 + $arr = []
  217 + instance = Instance.new
  218 + instance.run_initializers(:assets)
  219 + assert_equal [1, 3], $arr
  220 + end
214 221 end
215 222
216 223 class WithArgsTest < ActiveSupport::TestCase

0 comments on commit e9b02ae

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