-
-<%= submit_tag l(:button_save) %>
+<% administration_settings_tabs.each do |tab| %>
+ <%= content_tag('div', render(:partial => tab[:partial]), :id => "tab-content-#{tab[:name]}", :class => 'tab-content') %>
<% end %>
-<% html_title(l(:label_settings)) -%>
+<%= tab = params[:tab] ? h(params[:tab]) : administration_settings_tabs.first[:name]
+javascript_tag "showTab('#{tab}');" %>
+
+<% html_title(l(:label_settings), l(:label_administration)) -%>
diff --git a/lang/bg.yml b/lang/bg.yml
index 57e7fd22d..ae5630ecf 100644
--- a/lang/bg.yml
+++ b/lang/bg.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/cs.yml b/lang/cs.yml
index 5cbf1133d..813dade3f 100644
--- a/lang/cs.yml
+++ b/lang/cs.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/de.yml b/lang/de.yml
index ba3dcda5b..660289768 100644
--- a/lang/de.yml
+++ b/lang/de.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/en.yml b/lang/en.yml
index eae61d7bf..eec7702b7 100644
--- a/lang/en.yml
+++ b/lang/en.yml
@@ -353,6 +353,7 @@ label_contains: contains
label_not_contains: doesn't contain
label_day_plural: days
label_repository: Repository
+label_repository_plural: Repositories
label_browse: Browse
label_modification: %d change
label_modification_plural: %d changes
@@ -463,6 +464,7 @@ label_registration_automatic_activation: automatic account activation
label_display_per_page: 'Per page: %s'
label_age: Age
label_change_properties: Change properties
+label_general: General
button_login: Login
button_submit: Submit
diff --git a/lang/es.yml b/lang/es.yml
index 1a3af0f5c..37821e129 100644
--- a/lang/es.yml
+++ b/lang/es.yml
@@ -562,3 +562,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/fr.yml b/lang/fr.yml
index ff2bf792f..841f132d4 100644
--- a/lang/fr.yml
+++ b/lang/fr.yml
@@ -353,6 +353,7 @@ label_contains: contient
label_not_contains: ne contient pas
label_day_plural: jours
label_repository: Dépôt
+label_repository_plural: Dépôts
label_browse: Parcourir
label_modification: %d modification
label_modification_plural: %d modifications
@@ -463,6 +464,7 @@ label_registration_automatic_activation: activation automatique du compte
label_display_per_page: 'Par page: %s'
label_age: Age
label_change_properties: Changer les propriétés
+label_general: Général
button_login: Connexion
button_submit: Soumettre
diff --git a/lang/he.yml b/lang/he.yml
index d110ee8bf..666675e75 100644
--- a/lang/he.yml
+++ b/lang/he.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/it.yml b/lang/it.yml
index bb9440ffd..24e39955a 100644
--- a/lang/it.yml
+++ b/lang/it.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/ja.yml b/lang/ja.yml
index e4c13b34c..d68013296 100644
--- a/lang/ja.yml
+++ b/lang/ja.yml
@@ -560,3 +560,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/ko.yml b/lang/ko.yml
index 790598b8d..aad58d188 100644
--- a/lang/ko.yml
+++ b/lang/ko.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/nl.yml b/lang/nl.yml
index 2e18a6b7c..44633e4b4 100644
--- a/lang/nl.yml
+++ b/lang/nl.yml
@@ -560,3 +560,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/pl.yml b/lang/pl.yml
index 0ee0e3792..511bbe81a 100644
--- a/lang/pl.yml
+++ b/lang/pl.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/pt-br.yml b/lang/pt-br.yml
index 21d21b793..684b51daa 100644
--- a/lang/pt-br.yml
+++ b/lang/pt-br.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/pt.yml b/lang/pt.yml
index c7f05f8c8..0ce2d3471 100644
--- a/lang/pt.yml
+++ b/lang/pt.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/ro.yml b/lang/ro.yml
index 6ebc3b0e5..95e0ea318 100644
--- a/lang/ro.yml
+++ b/lang/ro.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/ru.yml b/lang/ru.yml
index 569e96884..fba18462e 100644
--- a/lang/ru.yml
+++ b/lang/ru.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/sr.yml b/lang/sr.yml
index 1d4f52539..ece6cf6e2 100644
--- a/lang/sr.yml
+++ b/lang/sr.yml
@@ -560,3 +560,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/sv.yml b/lang/sv.yml
index 75f297c20..cf1e760f9 100644
--- a/lang/sv.yml
+++ b/lang/sv.yml
@@ -560,3 +560,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml
index 5bf47d943..97b31225b 100644
--- a/lang/zh-tw.yml
+++ b/lang/zh-tw.yml
@@ -559,3 +559,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/lang/zh.yml b/lang/zh.yml
index 16f4c7195..2d537b250 100644
--- a/lang/zh.yml
+++ b/lang/zh.yml
@@ -562,3 +562,5 @@ text_no_configuration_data: "Roles, trackers, issue statuses and workflow have n
error_can_t_load_default_data: "Default configuration could not be loaded: %s"
button_update: Update
label_change_properties: Change properties
+label_general: General
+label_repository_plural: Repositories
diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb
index 742c1f6bb..05205b399 100644
--- a/test/functional/admin_controller_test.rb
+++ b/test/functional/admin_controller_test.rb
@@ -51,21 +51,9 @@ class AdminControllerTest < Test::Unit::TestCase
assert IssueStatus.find_by_name('Nouveau')
end
- def test_get_mail_options
- get :mail_options
- assert_response :success
- assert_template 'mail_options'
- end
-
- def test_post_mail_options
- post :mail_options, :settings => {'mail_from' => 'functional@test.foo'}
- assert_redirected_to 'admin/mail_options'
- assert_equal 'functional@test.foo', Setting.mail_from
- end
-
def test_test_email
get :test_email
- assert_redirected_to 'admin/mail_options'
+ assert_redirected_to 'settings/edit'
mail = ActionMailer::Base.deliveries.last
assert_kind_of TMail::Mail, mail
user = User.find(1)
diff --git a/test/functional/settings_controller_test.rb b/test/functional/settings_controller_test.rb
new file mode 100644
index 000000000..0e919a741
--- /dev/null
+++ b/test/functional/settings_controller_test.rb
@@ -0,0 +1,53 @@
+# redMine - project management software
+# Copyright (C) 2006-2007 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require File.dirname(__FILE__) + '/../test_helper'
+require 'settings_controller'
+
+# Re-raise errors caught by the controller.
+class SettingsController; def rescue_action(e) raise e end; end
+
+class SettingsControllerTest < Test::Unit::TestCase
+ fixtures :users
+
+ def setup
+ @controller = SettingsController.new
+ @request = ActionController::TestRequest.new
+ @response = ActionController::TestResponse.new
+ User.current = nil
+ @request.session[:user_id] = 1 # admin
+ end
+
+ def test_get_edit
+ get :edit
+ assert_response :success
+ assert_template 'edit'
+ end
+
+ def test_post_edit_notifications
+ post :edit, :settings => {:mail_from => 'functional@test.foo',
+ :bcc_recipients => '0',
+ :notified_events => %w(issue_added issue_updated news_added),
+ :emails_footer => 'Test footer'
+ }
+ assert_redirected_to 'settings/edit'
+ assert_equal 'functional@test.foo', Setting.mail_from
+ assert !Setting.bcc_recipients?
+ assert_equal %w(issue_added issue_updated news_added), Setting.notified_events
+ assert_equal 'Test footer', Setting.emails_footer
+ end
+end