Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit d5f3e15

Browse files
committed
Update component spec
1 parent 3ccc0bf commit d5f3e15

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

spec/component_spec.rb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,17 @@ def render
8787
renderToDocument(Foo)
8888
end
8989

90-
it "should allow block for life cycle helpers" do
91-
proc_a = Proc.new {}
92-
proc_b = Proc.new {}
90+
it "should allow block for life cycle callback" do
9391
Foo.class_eval do
94-
before_mount(&proc_a)
95-
after_mount(&proc_b)
92+
define_state(:foo)
93+
94+
before_mount do
95+
self.foo = "bar"
96+
end
9697
end
9798

98-
expect(proc_a).to receive(:call)
99-
expect(proc_b).to receive(:call)
100-
101-
renderToDocument(Foo)
99+
element = renderToDocument(Foo)
100+
expect(element.state.foo).to be("bar")
102101
end
103102
end
104103

0 commit comments

Comments
 (0)