X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f85681c5cee9406aacc1745a3fb3bd0331d3c0e4..e1213a4651e72beb660dddcf467d353744e3f336:/test/unit/user_test.rb?ds=sidebyside diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index ac2bd5e71..7d5f8dced 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -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