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

Commit 8878737

Browse files
committed
Remove usage of export_state in component_spec
1 parent 708720d commit 8878737

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

spec/react/component_spec.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,13 @@ def render
9595

9696
it 'allows block for life cycle callback' do
9797
Foo.class_eval do
98-
export_state(:foo)
99-
10098
before_mount do
101-
foo! 'bar'
99+
set_state({ foo: "bar" })
102100
end
103101
end
104102

105-
element = renderToDocument(Foo)
106-
expect(Foo.foo).to be('bar')
103+
instance = React::Test::Utils.render_into_document(element_to_render)
104+
expect(instance.state[:foo]).to be('bar')
107105
end
108106
end
109107

0 commit comments

Comments
 (0)