]> source.dussan.org Git - redmine.git/commitdiff
set user preference diff type nil at functional tests
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 28 Sep 2012 02:02:30 +0000 (02:02 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 28 Sep 2012 02:02:30 +0000 (02:02 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10501 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/attachments_controller_test.rb
test/functional/repositories_git_controller_test.rb

index bc37c31816c2b9f6484b6150d0189f04d1d82433..8c0375d6d0652afb541be66c7091ce82721df0b1 100644 (file)
@@ -96,8 +96,13 @@ class AttachmentsControllerTest < ActionController::TestCase
   end
 
   def test_save_diff_type
-    @request.session[:user_id] = 1 # admin
+    user1 = User.find(1)
+    user1.pref[:diff_type] = nil
+    user1.preference.save
     user = User.find(1)
+    assert_nil user.pref[:diff_type]
+
+    @request.session[:user_id] = 1 # admin
     get :show, :id => 5
     assert_response :success
     assert_template 'diff'
index 873b3e2847b4d3d5b881e372b6df28ec6da9402d..dc82f7c73c8fd17d38be3932090c31a4cf0510b3 100644 (file)
@@ -395,8 +395,13 @@ class RepositoriesGitControllerTest < ActionController::TestCase
     end
 
     def test_save_diff_type
-      @request.session[:user_id] = 1 # admin
+      user1 = User.find(1)
+      user1.pref[:diff_type] = nil
+      user1.preference.save
       user = User.find(1)
+      assert_nil user.pref[:diff_type]
+
+      @request.session[:user_id] = 1 # admin
       get :diff,
           :id   => PRJ_ID,
           :rev  => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'