tests for on method