diff --git a/tests/unit/observables/from-property-change-test.js b/tests/unit/observables/from-property-change-test.js index 2d4a82a..e272736 100644 --- a/tests/unit/observables/from-property-change-test.js +++ b/tests/unit/observables/from-property-change-test.js @@ -45,4 +45,21 @@ module("Unit | Observables | fromPropertyChange", function(hooks) { "Not called for the second change" ); }); + + test("it removed the property observer when unsubscribing", function(assert) { + const instance = Dummy.create(); + const removeObserver = td.replace(instance, "removeObserver"); + + const observer = td.function(); + const subscription = fromPropertyChange(instance, "foo").subscribe( + observer + ); + + subscription.unsubscribe(); + + assert.verify( + removeObserver("foo", instance, td.matchers.isA(Function)), + "Removes the property observer when unsubscribing" + ); + }); });