--- /dev/null
+class ChangeUserPreferencesHideMailDefaultToTrue < ActiveRecord::Migration
+ def self.up
+ change_column :user_preferences, :hide_mail, :boolean, :default => true
+ end
+
+ def self.down
+ change_column :user_preferences, :hide_mail, :boolean, :default => false
+ end
+end
class UserPreferenceTest < ActiveSupport::TestCase
fixtures :users, :user_preferences
+ def test_hide_mail_should_default_to_true
+ preference = UserPreference.new
+ assert_equal true, preference.hide_mail
+ end
+
def test_create
user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo")
user.login = "newuser"