X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/303e5d3eb99284ab4fa41be85f831333f2154b0d..a543e731c0433b2aa0f0f1583f7c70182a084fd5:/test/unit/user_test.rb 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