]> git.openstreetmap.org Git - rails.git/blobdiff - test/models/changeset_test.rb
Write browse element icons as <img>
[rails.git] / test / models / changeset_test.rb
index 3be9a52e636fc8ba9d58d64c5022226a673f480f..affa773d19294f91fee7dcd4c2a4d5e8f8188fca 100644 (file)
@@ -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