1 require File.dirname(__FILE__) + '/../test_helper'
3 class UserPreferenceTest < ActiveSupport::TestCase
4 fixtures :users, :user_preferences
6 # This checks to make sure that there are two user preferences
7 # stored in the test database.
8 # This test needs to be updated for every addition/deletion from
11 assert_equal 2, UserPreference.count
14 # Checks that you cannot add a new preference, that is a duplicate
15 def test_add_duplicate_preference
16 up = user_preferences(:a)
17 newUP = UserPreference.new
18 newUP.user = users(:normal_user)
20 newUP.v = "some other value"
21 assert_not_equal newUP.v, up.v
22 assert_raise (ActiveRecord::StatementInvalid) {newUP.save}