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

Commit 76c60b9

Browse files
committed
let session force a render
1 parent 76d3dd1 commit 76c60b9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/react/test/session.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ def component
2121
def update_params(params)
2222
component.set_props(params)
2323
end
24+
25+
def force_update!
26+
component.force_update!
27+
end
2428
end
2529
end
2630
end

spec/react/test/session_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ def render
6868
subject.update_params(message: 'moon')
6969
expect(component.params.from).to eq('outerspace')
7070
end
71+
72+
describe '#force_update' do
73+
it 'causes the component to render' do
74+
component = subject.mount(Greeter)
75+
expect(component).to receive(:render)
76+
subject.force_update!
77+
end
7178
end
7279
end
7380
end

0 commit comments

Comments
 (0)