X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/88ba316abeecffccd1cb51c63ce5594c95023624..7af9a60eccf55806a452186995b87ebab1b5b230:/test/models/changeset_test.rb 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