Move on_load outside the block because in tests the :on_load doesn't seem to be correctly triggered.
Move on_load outside the block because in tests the :on_load doesn't seem to be correctly triggered.

The other alternative is to trigger the event manually, like several libraries do.

E.g. https://github.com/voxdolo/decent_exposure/blob/master/spec/lib/rails_integration_spec.rb
weppos/tabs_on_rails,ipmobiletech/tabs_on_rails,weppos/tabs_on_rails,ipmobiletech/tabs_on_rails