X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/4347d9d3b00a8fffe78daa93eac5b490905f9ac8..e15a92a30213d87e10e000a240a7dcab66c208b4:/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