]> git.openstreetmap.org Git - rails.git/blobdiff - test/unit/user_test.rb
Initial work on support for multiple editors
[rails.git] / test / unit / user_test.rb
index ac2bd5e7145997613879b21d3cf1dbc5439c761c..7d5f8dced28c50bc9f37560cfeac4abf59edfd32 100644 (file)
@@ -138,4 +138,15 @@ class UserTest < ActiveSupport::TestCase
     #Friend.delete(friend)
     #assert_equal 0, Friend.count
   end
+
+  def test_user_preferred_editor
+    user = users(:normal_user)
+    assert_equal nil, user.preferred_editor
+    user.preferred_editor = "potlatch"
+    assert_equal "potlatch", user.preferred_editor
+    user.save!
+
+    user.preferred_editor = "invalid_editor"
+    assert_raise(ActiveRecord::RecordInvalid) { user.save! }
+  end
 end