X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/582402ba8fe5cb3f7a9934844cf33678a3365f45..108984f04af55561898a6ae3dbb42cf0bef81674:/test/models/changeset_test.rb?ds=inline diff --git a/test/models/changeset_test.rb b/test/models/changeset_test.rb index 3be9a52e6..affa773d1 100644 --- a/test/models/changeset_test.rb +++ b/test/models/changeset_test.rb @@ -71,4 +71,17 @@ class ChangesetTest < ActiveSupport::TestCase Changeset.from_xml(xml, :create => true) end end + + def test_subscription + changeset = create(:changeset) + user = create(:user) + + assert_not changeset.subscribed?(user) + + changeset.subscribe(user) + assert changeset.subscribed?(user) + + changeset.unsubscribe(changeset.subscribers.first) + assert_not changeset.subscribed?(user) + end end