]> source.dussan.org Git - redmine.git/commitdiff
More function tests for AdminController.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 10 Mar 2012 13:41:56 +0000 (13:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 10 Mar 2012 13:41:56 +0000 (13:41 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9170 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/admin_controller_test.rb

index dea8b301eca5c413ab4e1d161cdf9f56a117904c..2ba84179e28a30a0b0ec99e3e175deccf946576c 100644 (file)
@@ -74,6 +74,15 @@ class AdminControllerTest < ActionController::TestCase
     assert IssueStatus.find_by_name('Nouveau')
   end
 
+  def test_load_default_configuration_data_should_rescue_error
+    delete_configuration_data
+    Redmine::DefaultData::Loader.stubs(:load).raises(Exception.new("Something went wrong"))
+    post :default_configuration, :lang => 'fr'
+    assert_response :redirect
+    assert_not_nil flash[:error]
+    assert_match /Something went wrong/, flash[:error]
+  end
+
   def test_test_email
     get :test_email
     assert_redirected_to '/settings/edit?tab=notifications'