X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/88ba316abeecffccd1cb51c63ce5594c95023624..108984f04af55561898a6ae3dbb42cf0bef81674:/test/models/changeset_test.rb?ds=sidebyside 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