Enabling an element that has been previously enabled should have no effect

After an element is enabled, its data attribute 'ujs:enable_with' is set to false. If $.rails.enableElement is then called again it will try to enable it again, since we are checking if it is not undefined.

I've not managed to create an async test suite that would catch this bug, because it is a very complex scenario, so I went for a simple unit test that would expose the bug.

Any thoughts?