diff test/functional/.svn/text-base/welcome_controller_test.rb.svn-base @ 245:051f544170fe

* Update to SVN trunk revision 4993
author Chris Cannam
date Thu, 03 Mar 2011 11:42:28 +0000
parents 8661b858af72
children
line wrap: on
line diff
--- a/test/functional/.svn/text-base/welcome_controller_test.rb.svn-base	Thu Mar 03 11:40:10 2011 +0000
+++ b/test/functional/.svn/text-base/welcome_controller_test.rb.svn-base	Thu Mar 03 11:42:28 2011 +0000
@@ -67,4 +67,28 @@
     assert_equal 'text/plain', @response.content_type
     assert @response.body.match(%r{^Disallow: /projects/ecookbook/issues\r?$})
   end
+  
+  def test_warn_on_leaving_unsaved_turn_on
+    user = User.find(2)
+    user.pref.warn_on_leaving_unsaved = '1'
+    user.pref.save!
+    @request.session[:user_id] = 2
+    
+    get :index
+    assert_tag 'script',
+      :attributes => {:type => "text/javascript"},
+      :content => %r{new WarnLeavingUnsaved}
+  end
+  
+  def test_warn_on_leaving_unsaved_turn_off
+    user = User.find(2)
+    user.pref.warn_on_leaving_unsaved = '0'
+    user.pref.save!
+    @request.session[:user_id] = 2
+    
+    get :index
+    assert_no_tag 'script',
+      :attributes => {:type => "text/javascript"},
+      :content => %r{new WarnLeavingUnsaved}
+  end
 end